www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23166] New: seg fault when compiling with -inline


          Issue ID: 23166
           Summary: seg fault when compiling with -inline
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

The following:

bool __equals(scope const char[] lhs, scope const char[] rhs)
    if (lhs.length != rhs.length)
        return false;

        import core.stdc.string : memcmp;
        return lhs.length == 0;
    return true;

int test(string type)
    return __equals(type, "as-is");

generates a seg fault when compiling with -inline. The seg fault is on line
4008 of e2ir.d:

    switch (e.op)

The import statement appears to be the trigger.

Jun 06 2022