Bug 19185 – [ICE] Nested struct segfaults when using variable from outer scope

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-08-22T14:06:26Z
Last change time
2018-09-06T15:43:34Z
Keywords
ice, pull
Assigned to
No Owner
Creator
RazvanN

Comments

Comment #0 by razvan.nitu1305 — 2018-08-22T14:06:26Z
void fun() { int x = 2; struct A { int a; this(int a) { this.a = a + x; // segault here } } A a = 5; // A a = A(5); initializing `a` like this works as expected } void main() { fun(); }
Comment #1 by razvan.nitu1305 — 2018-08-22T14:33:23Z
Comment #2 by github-bugzilla — 2018-09-06T15:43:33Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/9b5a295e8707a17bee8e45e0337935ed568bcff9 Fix Issue 19185 - [ICE] Nested struct segfaults when using variable from outer scope https://github.com/dlang/dmd/commit/88de313bb92b3fb181cc0198b490422b1ab57407 Merge pull request #8597 from RazvanN7/Issue_19185 Fix Issue 19185 - [ICE] Nested struct segfaults when using variable from outer scope merged-on-behalf-of: Razvan Nitu <[email protected]>