www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17380] New: [REG 2.074.0] Compiler segfaults on undefined

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 puremagic.com
          Reporter: kai 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.

--
May 07 2017