https://issues.dlang.org/show_bug.cgi?id=22397
--- Comment #5 from Vladimir Panteleev <[email protected]> --- Maybe something like this to avoid saying that out-of-memory errors are compiler bugs: diff --git a/src/dmd/mars.d b/src/dmd/mars.d index 54c8298ea9..344ad207e2 100644 --- a/src/dmd/mars.d +++ b/src/dmd/mars.d @@ -1064,10 +1064,18 @@ else dmd_coverSetMerge(true); } - scope(failure) stderr.printInternalFailure; - - auto args = Runtime.cArgs(); - return tryMain(args.argc, cast(const(char)**)args.argv, global.params); + try + { + auto args = Runtime.cArgs(); + return tryMain(args.argc, cast(const(char)**)args.argv, global.params); + } + catch (OutOfMemoryError e) + throw e; + catch (Throwable e) + { + stderr.printInternalFailure; + throw e; + } } } // !NoMain --
