Bug 8276 – [CTFE] ICE when reading variable from nested function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-20T23:45:00Z
Last change time
2015-06-09T05:11:35Z
Keywords
CTFE, ice
Assigned to
nobody
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2012-06-20T23:45:45Z
void blah(int n) { const int X = 4 + n; // ICE // const int X = 4; // ok // int X = 4; // ICE int far() { return X; } static assert(far()); } dmd: interpret.c:2019: Expression* getVarExp(Loc, InterState*, Declaration*, CtfeGoal): Assertion `0' failed.
Comment #1 by github-bugzilla — 2012-06-25T14:55:30Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/02d3d195757654a77f7fb79dda692834c5b35aab Fix issue 8276 [CTFE] ICE when reading variable from nested function https://github.com/D-Programming-Language/dmd/commit/09d99346d5cb174c0d266f9d89446c9cdb577c91 Merge pull request #1026 from donc/ice8276ctfeNested Fix issue 8276 [CTFE] ICE when reading variable from nested function