Bug 17409 – [ICE] Segmentation fault with invalid code and -dip1000

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-05-18T12:45:00Z
Last change time
2017-05-29T04:44:32Z
Keywords
safe
Assigned to
nobody
Creator
mathias.lang

Comments

Comment #0 by mathias.lang — 2017-05-18T12:45:20Z
The following code: ``` void main () @safe { scope void delegate (void*) @safe s = (a) {}; scope void* ptr; s(ptr); } ``` Compiles correctly with `dmd test.d` and segfault when compiler with `dmd -dip1000 test.d`. I would expect compilation to fail as it attempts to pass a `scope void*` to a delegate accepting `void*`. Tested with 2.074 and master (v2.075.0-devel-f234dde37).
Comment #1 by bugzilla — 2017-05-29T04:44:32Z
I get: test.d(5): Error: scope variable ptr assigned to non-scope parameter unnamed calling indirectly when I try it with the latest.