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.
Comment #3 by yebblies — 2014-07-26T15:19:51Z
Comment #4 by k.hara.pg — 2015-03-05T16:21:57Z
Comment #5 by github-bugzilla — 2015-04-09T02:05:25Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ee243b618c48d3e99dc6af861cbc89c5c5f1b461 fix Issue 10492 - Illegal Instruction for mixin template with scope declarations
Comment #6 by github-bugzilla — 2015-06-17T21:04:35Z
Commit pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ee243b618c48d3e99dc6af861cbc89c5c5f1b461 fix Issue 10492 - Illegal Instruction for mixin template with scope declarations