[Issue 22175] New: Nested method access to variable formed by ternary of constructor and function call, of a struct with four shorts and a bool, crashes DMD.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 4 06:39:09 UTC 2021


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

          Issue ID: 22175
           Summary: Nested method access to variable formed by ternary of
                    constructor and function call, of a struct with four
                    shorts and a bool, crashes DMD.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

Consider this code:

struct Struct
{
    short a, b, c, d;
    bool e;
}

Struct foo() { return Struct(); }

void main() {
    int i;
    Struct var = i ? Struct() : foo;
    Struct test() { return var; }
}

DMD crashes in the backend since 2.097.0.

--


More information about the Digitalmars-d-bugs mailing list