[Issue 20596] [REG2.086] Error on missed stack allocation for closure for template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 5 07:14:09 UTC 2020


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

--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
Here's the problem. There were two PRs:

https://github.com/dlang/dmd/pull/8504

which extended checking of addressing of delegates to constructor calls with
the line in expressionsem.d:

     if (global.params.vsafe && checkConstructorEscape(sc, cx, false))
          return setError();

which winds up calling the line in escape.d:

     if (va && va.isScope() && fd.tookAddressOf && global.params.vsafe)
          --fd.tookAddressOf;

added by PR:

     https://github.com/dlang/dmd/pull/7981

which when combined produces the regression. The regression goes away when the
two checks for global.params.vsafe (i.e. dip1000) are removed. The message did
not appear before because constructor calls were not checked for escaping
arguments.

--


More information about the Digitalmars-d-bugs mailing list