Bug 19491 – ICE (segfault) when initializing scope variable with shared type

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-12-15T14:39:52Z
Last change time
2018-12-24T19:22:43Z
Assigned to
No Owner
Creator
Chloé

Comments

Comment #0 by rightfold+bugzilla+dlang — 2018-12-15T14:39:52Z
Tested with DMD 2.081.2. This bug does not seem to occur on DMD 2.073. The following example causes DMD to ICE with a segfault: $ cat example.d class Foo { shared this() { } } void main() { scope foo = new shared Foo(); } $ dmd example.d Segmentation fault If you replace scope by auto then it will compile just fine.
Comment #1 by razvan.nitu1305 — 2018-12-17T10:22:36Z
This looks like a backend bug.
Comment #2 by bugzilla — 2018-12-21T07:22:27Z
Comment #3 by github-bugzilla — 2018-12-24T19:22:42Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/2d658b7ed076ba789e67907ec37be2ff0671fd1f fix Issue 19491 - ICE (segfault) when initializing scope variable with shared type https://github.com/dlang/dmd/commit/57c8a5e4a70144846359051d7c9c1ff4612cbd57 Merge pull request #9109 from WalterBright/fix19491 fix Issue 19491 - ICE (segfault) when initializing scope variable wit… merged-on-behalf-of: Walter Bright <[email protected]>