mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-28 12:46:56 +00:00
ac4087856f
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. |
||
---|---|---|
.. | ||
decoders | ||
fonts | ||
scaler | ||
colormasks.h | ||
conversion.cpp | ||
conversion.h | ||
cursor.h | ||
cursorman.cpp | ||
cursorman.h | ||
font.cpp | ||
font.h | ||
fontman.cpp | ||
fontman.h | ||
maccursor.cpp | ||
maccursor.h | ||
module.mk | ||
palette.h | ||
pixelformat.h | ||
primitives.cpp | ||
primitives.h | ||
scaler.cpp | ||
scaler.h | ||
sjis.cpp | ||
sjis.h | ||
surface.cpp | ||
surface.h | ||
thumbnail.cpp | ||
thumbnail.h | ||
VectorRenderer.cpp | ||
VectorRenderer.h | ||
VectorRendererSpec.cpp | ||
VectorRendererSpec.h | ||
wincursor.cpp | ||
wincursor.h | ||
yuv_to_rgb.cpp | ||
yuv_to_rgb.h |