[Issue 20581] DIP1000 wrongly flags hidden ref temporary
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Apr 4 09:46:20 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20581
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at digitalmars.com
--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
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.
--
More information about the Digitalmars-d-bugs
mailing list