Bug 9445 – interpret.c:151: Assertion `v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()' failed.

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-02T22:57:00Z
Last change time
2015-06-09T05:11:55Z
Keywords
CTFE, ice, pull
Assigned to
nobody
Creator
Marco.Leise

Comments

Comment #0 by Marco.Leise — 2013-02-02T22:57:46Z
I don't know how to describe the error, but here is some reduced code that provokes the error in DMD 2.061: --- Vector.d --- import Rotate; import Scale; struct SVector(T) { this(T) {} ref opOpAssign(string op)(T) {} ref opOpAssign(string op)(SScale!T) {} void foo() { this *= 1.0; } } struct SNormal(T) { this(SVector!T) { SVector!T().foo; } } --- Scale.d --- import Vector; struct SScale(T) { auto aaa = SVector!T(1.0); } --- Rotate.d --- import Vector; struct SRotate(T) { this()(int) {} this()(char) { SRotate!T(0); SNormal!T aaa = SVector!T(); } } auto bbb = SRotate!(float)('A'); ---------------- Compiled with "dmd Vector.d"
Comment #1 by callumenator — 2013-03-03T16:51:45Z
Another trigger, DMD 2.062: import std.traits, std.typecons; void bug(E)(lazy E expr) { alias ReturnType!expr RT; } void main() { bug(RefCounted!int(0)); }
Comment #2 by clugdbug — 2013-04-08T02:56:45Z
The original test case works for me in 2.062. Reduced test case for comment 1: template c9445(T...) { static assert(is(typeof( & T[0].xxx ))); } void bug9445(void delegate() expr) { static assert( c9445!( expr() ) ); }
Comment #3 by github-bugzilla — 2013-04-08T05:19:05Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b3dc0e56eab752fdefc9b591bba6523601514bd2 Fix issue 9445 ICE(interpret.c) calling parameter in CTFE Typo: should be checking variable has a value, not getting the value (which will ICE if it has no value).
Comment #4 by yebblies — 2013-04-08T05:36:26Z
Fixed for D2.
Comment #5 by github-bugzilla — 2013-04-18T11:23:14Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fc4aae260f2ee92b652680adc8f1f933c43d1ffd Fix issue 9445 ICE(interpret.c) calling parameter in CTFE Typo: should be checking variable has a value, not getting the value (which will ICE if it has no value).