[Issue 22124] Corrupted closure when compiling with -preview=dip1000

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 14 13:33:59 UTC 2021


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl

--- Comment #2 from Dennis <dkorpel at live.nl> ---
Probably a combination of issue 20150 and/or issue 21912.

See also my thread example in:
https://forum.dlang.org/thread/jnkdcngzytgtobihzggj@forum.dlang.org

A closure should be created on the heap for the stackframe of fun4, but dmd
doesn't do that because Thread's constructor is `pure` so the delegate becomes
`scope`. We can make the parameter in the constructor explicitly `return
scope`, but considering issue 21912, that might not be enough.

--


More information about the Digitalmars-d-bugs mailing list