Bug 10492 – Illegal Instruction for mixin template with scope declarations
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-27T18:51:00Z
Last change time
2015-06-17T21:04:35Z
Keywords
ice, pull, wrong-code
Assigned to
yebblies
Creator
changlon
Comments
Comment #0 by changlon — 2013-06-27T18:51:54Z
code:
----------------------
class TestClass{}
mixin template test(string name){
mixin("scope " ~ name ~ " = new TestClass;" );
}
void main(){
mixin test!("var");
}
---------------------
run error:
--------------------
object.Error: Illegal Instruction
----------------
0x0012FE30
0x00402BFC
0x00402C37
0x00402835
0x00402098
0x7C817067 in RegisterWaitForInputIdle
--------------------
Comment #1 by yebblies — 2013-11-24T05:17:10Z
class TestClass{}
mixin template test()
{
scope var = new TestClass;
}
void main(){
mixin test!();
}
The compiler wraps eh code around the var to run the destructor, and it looks like it fails to restore esp correctly on exit.
Comment #2 by yebblies — 2014-07-24T09:25:44Z
When using a debug build of dmd compiling with -O --b ices the compiler.