← Back to index
|
Original Bugzilla link
Bug 9938 – ICE using global interface variable in CTFE
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-16T04:57:00Z
Last change time
2015-06-09T05:11:41Z
Assigned to
nobody
Creator
clugdbug
Comments
Comment #0
by clugdbug — 2013-04-16T04:57:31Z
The new tests for CTFE class variables cause an assert failure if run at compile time. dmd: interpret.c:164: Expression* CtfeStack::getValue(VarDeclaration*): Assertion `v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < globalValues.dim' failed. Aborted ====== diff --git a/test/runnable/interpret.d b/test/runnable/interpret.d index 38735e6..53fbe1f 100644 --- a/test/runnable/interpret.d +++ b/test/runnable/interpret.d @@ -2871,7 +2871,7 @@ const ITest105a t105ia = new Test105b('E', 88, 'A', 99); __gshared Test105b t105gs = new Test105b('E', 88, 'A', 99); shared Test105b t105bs = new shared(Test105b)('E', 88, 'A', 99); immutable Test105b t105bi = new immutable(Test105b)('E', 88, 'A', 99); -void test105() +bool test105() { assert(t105b.a == 'A'); assert(t105b.b == 99); @@ -2920,9 +2920,11 @@ void test105() assert(t105bi.f == 88); assert(t105bi.test105a() == "test105a"); assert(t105bi.test105b() == "test105b"); - + return true; } +static assert(test105()); +
Comment #1
by bugzilla — 2013-04-17T14:02:39Z
https://github.com/D-Programming-Language/dmd/pull/1906
Comment #2
by github-bugzilla — 2013-04-17T14:03:12Z
Commit pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/de3a12435a92b6309ab11684c149eb527e458b75
Fix issue 9938 ICE using global interface variable in CTFE Can't just use getValue() to get the value of the 'this', it might be a global.