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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8276 - [CTFE] ICE when reading variable from nested function
Summary: [CTFE] ICE when reading variable from nested function
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: CTFE, ice
Depends on:
Blocks:
Reported: 2012年06月20日 23:45 UTC by Don
Modified: 2015年06月09日 05:11 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2012年06月20日 23:45:45 UTC
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 github-bugzilla 2012年06月25日 14:55:30 UTC
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


AltStyle によって変換されたページ (->オリジナル) /