scummvm/engines/sci
D G Turner ac4087856f ALL: Remove optimization unstable code on checking for null after new.
These issues were identified by the STACK tool.

By default, the C++ new operator will throw an exception on allocation
failure, rather than returning a null pointer.

The result is that testing the returned pointer for null is redundant
and _may_ be removed by the compiler. This is thus optimization
unstable and may result in incorrect behaviour at runtime.

However, we do not use exceptions as they are not supported by all
compilers and may be disabled.

To make this stable without removing the null check, you could qualify
the new operator call with std::nothrow to indicate that this should
return a null, rather than throwing an exception.

However, using (std::nothrow) was not desirable due to the Symbian
toolchain lacking a <new> header.
A global solution to this was also not easy by redefining "new" as "new
(std::nothrow)" due to custom constructors in NDS toolchain and various
common classes.

Also, this would then need explicit checks for OOM adding to all new
usages as per C malloc which is untidy.

For now to remove this optimisation unstable code is best as it is
likely to not be present anyway, and OOM will cause a system library
exception instead, even without exceptions enabled in the application
code.
2014-01-15 02:36:19 +00:00
..
engine SCI: injecting "dual" view into King's Quest 6 CD 2013-12-24 23:31:17 +01:00
graphics ALL: Remove optimization unstable code on checking for null after new. 2014-01-15 02:36:19 +00:00
parser SCI: Fix (unlikely) memory leak 2013-04-25 20:48:32 +02:00
sound SCI: Fix memory leak 2014-01-06 21:37:31 +01:00
video SCI: Take advantage of Surface::getPixels. 2013-08-03 04:02:52 +02:00
configure.engine BUILD: Split configure.engines down to a single file per engine. 2013-11-24 00:45:38 +00:00
console.cpp SCI: script patcher is now a separate class 2013-12-04 20:42:16 +01:00
console.h SCI: Remove unused variable 2013-04-15 20:58:22 +02:00
debug.h GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
decompressor.cpp SCI: Fix potential (but probably very unlikely) memory leak 2013-01-02 20:19:36 +01:00
decompressor.h JANITORIAL: Remove trailing empty lines. 2011-08-07 13:53:33 +02:00
detection_tables.h SCI: remove undither option for SCI1early+ games 2013-12-26 17:39:53 +01:00
detection.cpp SCI: Add support for the King's Questions mini-game 2013-08-20 19:48:33 +03:00
event.cpp SCI: Minor formatting fixes. 2013-01-14 21:07:20 +01:00
event.h GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
module.mk SCI: Implement the file operations needed for the save dialog in Phantasmagoria 2012-06-13 12:26:49 +03:00
POTFILES I18N: Move specification of engine specific files to enginedir/POTFILES. 2013-08-12 17:54:31 +02:00
resource_audio.cpp SCI: Rewrite MIDI channel remapping 2013-12-31 13:52:15 +01:00
resource_intern.h SCI: Fix memory leak 2013-04-20 16:27:59 +02:00
resource.cpp SCI: Add handling for the RAVE resource type, found in KQ6CD 2013-12-10 01:41:15 +02:00
resource.h SCI: Rewrite MIDI channel remapping 2013-12-31 13:52:15 +01:00
sci.cpp SCI: improved lb2+kq6 patches (new speech state) 2013-12-22 20:46:54 +01:00
sci.h SCI: script patcher is now a separate class 2013-12-04 20:42:16 +01:00
util.cpp GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
util.h GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00