[Issue 20581] DIP1000 wrongly flags hidden ref temporary

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 4 10:34:44 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20581

--- Comment #2 from moonlightsentinel at disroot.org ---
(In reply to Walter Bright from comment #1)
> The cause of this is that assert() may throw an exception and so the stack
> reference (used by -checkaction=context) will outlive main() as the stack is
> unwound.
> 
> The error is correctly generated, suppressing it will lead to stack
> corruption. I don't think much can be done about it. For context to work,
> the assert() expression needs to not rely on pointers into the stack frame.

No, the stack reference is not part of the exception because __assertOp4 is
turned into a string before throwing an exception.

--


More information about the Digitalmars-d-bugs mailing list