[Issue 19316] GC runtime breaks @safe
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 21 18:27:56 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19316
Stanislav Blinov <stanislav.blinov at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|INVALID |---
--- Comment #2 from Stanislav Blinov <stanislav.blinov at gmail.com> ---
It is being passed: C may define static data accessible to 'safeFunc'.
The point is, this includes any arbitrary un- at safe code, e.g. catching an Error
or even a Throwable. Net effect is that this code:
static C c;
void safeFunc() @safe {
destroy(c);
}
would fail to compile, and yet that same code executes via GC.
There's another unfortunate consequence of this behavior: 'pure' is also
affected, as is nothrow (though the latter terminates the program anyway as it
results in a FinalizationError).
--
More information about the Digitalmars-d-bugs
mailing list