VOGONS


First post, by realnc

User metadata
Rank Oldbie
Rank
Oldbie

MEMORY::MEMORY(Section*) has a bug where it uses the throwing 'new' but then checks for null, which will actually never detect an allocation failure because an exception will be thrown. The attached patch fixes it.

Reply 2 of 3, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Not sure about which C++ version this is for.
It might be for a relative new one.

Water flows down the stream
How to ask questions the smart way!

Reply 3 of 3, by realnc

User metadata
Rank Oldbie
Rank
Oldbie
Qbix wrote on 2020-05-05, 10:25:

Not sure about which C++ version this is for.
It might be for a relative new one.

No, it worked like that since the beginning. This is the C++ standard document from 2005 for example:

http://www.open-std.org/jtc1/sc22/wg21/docs/p … /2005/n1905.pdf

cppreference.com also always marks things as "C++11/14/17/20" for things that were added later to the language, and this one doesn't have such tag:

https://en.cppreference.com/w/cpp/memory/new/nothrow