[Issue 17380] New: [REG 2.074.0] Compiler segfaults on undefined symbol

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 7 04:04:30 PDT 2017


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

          Issue ID: 17380
           Summary: [REG 2.074.0] Compiler segfaults on undefined symbol
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: kai at redstar.de

Created attachment 1645
  --> https://issues.dlang.org/attachment.cgi?id=1645&action=edit
Source file demonstrating the bug.

Compiling the attached source with dmd -unittest -main bug.d, dmd segfaults.
When line 88 is replaced by line 89 then it compiles and links.

The culprit is an undefined symbol:

        Uint128 opCast(T : Uint128)()
        {
            return ThisTypeDoesNotExistsAndCrahesTheCompiler(v);
        }

Changing to

        Uint128 opCast(T : Uint128)()
        {
            return Uint128(0);
        }

dmd does not crash.

--


More information about the Digitalmars-d-bugs mailing list