[Issue 22095] New: Closure not created or corrupted when accessing pointer in inline function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 1 06:17:13 UTC 2021


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

          Issue ID: 22095
           Summary: Closure not created or corrupted when accessing
                    pointer in inline function
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: safe, wrong-code
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dlang-bugzilla at thecybershadow.net

///////////////// test.d /////////////////
struct S
{
    int[5] i; // must be 5 or greater
}

void main()
{
    void delegate() dg;

    (){
        S s = {[1,2,3,4,5]};
        auto pS = &s;
        dg = {
            assert(*pS == S([1,2,3,4,5]));
        };
    }();

    dg();
}
//////////////////////////////////////////

The assection

--


More information about the Digitalmars-d-bugs mailing list