www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21067] New: Tupleof of struct returned by function with


          Issue ID: 21067
           Summary: Tupleof of struct returned by function with string
                    field lazily passed to function, itself lazily passed
                    to another function, causes runtime OOM.
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

Consider the following, remarkable code:

struct S { int b; string s; }

S test() { return S(); }

void main()

void dupArg2(int, lazy string msg)

void evalArg(lazy void expression)
    try expression();
    finally { }

When built and run with DMD, I get an OOM error.

LDC gives the somewhat more helpful error:

test.d(7): Error: function test.main.__dgliteral1 cannot access frame of
function test.main.__dgliteral2

For the evalArg call. Indicating the issue is related to the double-nesting of

Jul 23 2020