D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17409 - [ICE] Segmentation fault with invalid code and -dip1000
Summary: [ICE] Segmentation fault with invalid code and -dip1000
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: safe
Depends on:
Blocks:
 
Reported: 2017-05-18 12:45 UTC by Mathias Lang
Modified: 2017-05-29 04:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mathias Lang 2017-05-18 12:45:20 UTC
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 Walter Bright 2017-05-29 04:44:32 UTC
I get:

test.d(5): Error: scope variable ptr assigned to non-scope parameter unnamed calling indirectly

when I try it with the latest.