Scope failure is not preventing application crush in case of uncaught exceptions
Anonymouse
asdf at asdf.net
Sun Dec 17 09:47:35 UTC 2017
On Sunday, 17 December 2017 at 08:10:06 UTC, codephantom wrote:
> On Sunday, 17 December 2017 at 00:10:27 UTC, Anonymouse wrote:
>> If you return inside a scopeguard though, the exception (or
>> error!) is swallowed. https://run.dlang.io/is/GEtQ6D
>
> The scope guard will not 'swallow' it, if you use -release mode.
>
> Which suggests to me, that assert(0) operates differently when
> 'not' using -release mode.
>
> My 'guess' is, that release mode issues a halt instruction,
> whereas in non-release mode it is just an exception like any
> other exception.
Apologies. I chose assert(0) just to show that it catches Errors
too, so just replace it with throw new Exception and it behaves
the same without opening that can of worms.
More information about the Digitalmars-d-learn
mailing list