Bug 6037 – [CTFE] recursive ref parameters evaluated incorrectly

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-05-19T12:33:00Z
Last change time
2015-06-09T05:11:46Z
Keywords
wrong-code
Assigned to
nobody
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2011-05-19T12:33:11Z
To fix this, CTFE will need to properly implement a stack for variables to be stored on. ------------- void bug6037(ref int x, bool b){ int w = 3; if (b) { bug6037(w, false); assert(w==6); } else { x = 6; assert(w==3); // fails } } int bug6037outer(){ int q; bug6037(q, true); return 401; } static assert(bug6037outer() == 401);
Comment #1 by bugzilla — 2011-12-31T15:21:44Z