www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18670] New: compiler segfault if `new` on a union type with

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

          Issue ID: 18670
           Summary: compiler segfault if `new` on a union type with
                    dip1000
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

Found while trying to compile Adam D. Ruppe's terminal-emulator, reduced with
dustmite and some manual work

% cat terminalemulator.d
void foo() {
        new OVERLAPPED;
}

union OVERLAPPED {
        uint     OffsetHigh;
        uint     Pointer;
}
% gdb dmd
< ... blah blah ... >
(gdb) r terminalemulator.d -dip1000
< ... blah blah ... >
DMD v2.079.0-283-g2e21d0713-dirty DEBUG

Program received signal SIGSEGV, Segmentation fault.
0x000000000059f2bd in dmd.escape.escapeByValue(dmd.expression.Expression,
dmd.escape.EscapeByResults*) (er=0x7ffffffeca60, e=0x0) at dmd/escape.d:1293
1293        e.accept(v);
(gdb) bt

dmd.escape.EscapeByResults*) (er=0x7ffffffeca60, e=0x0) at dmd/escape.d:1293

dmd.expression.Expression, bool) (gag=false, e=0x0, sc=0x7ffffe274120) at
dmd/escape.d:592

(this=0x7ffffffecf08, exp=0x7fffff6b53b0) at dmd/expressionsem.d:2363

v=0x7ffffffecf08) at dmd/expression.d:4155

(e=0x7fffff6b53b0, sc=0x7ffffe274120) at dmd/expressionsem.d:9367

(this=0x7ffffffecfd8, s=0x7fffff6b5420) at dmd/statementsem.d:177

v=0x7ffffffecfd8) at dmd/statement.d:715

(s=0x7fffff6b5420, sc=0x7ffffe274120) at dmd/statementsem.d:126

(this=0x7ffffffed2d8, cs=0x7fffff6b5440) at dmd/statementsem.d:235

(this=0x7fffff6b5440, v=0x7ffffffed2d8) at dmd/statement.d:908

(s=0x7fffff6b5440, sc=0x7ffffe274120) at dmd/statementsem.d:126

(this=0x7ffffffedb80, funcdecl=0x7fffff6b5060) at dmd/semantic3.d:581

(this=0x7fffff6b5060, v=0x7ffffffedb80) at dmd/func.d:2277

sc=0x7ffffe273e30) at dmd/semantic3.d:82

(this=0x7ffffffedc30, mod=0x7fffff6b4c00) at dmd/semantic3.d:193

v=0x7ffffffedc30) at dmd/dmodule.d:1322

sc=0x0) at dmd/semantic3.d:82

(argv=0x7ffffffee958, argc=3) at dmd/mars.d:836


--
Mar 27 2018