Bug 6053 – [CTFE] Two ICEs involving pointers (dereference and assign; pointer variable on stack)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-05-24T11:37:00Z
Last change time
2011-06-10T12:45:29Z
Keywords
ice-on-invalid-code
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-05-24T11:37:43Z
Test case 1: ---------------- static assert({ int* a; return true; }()); ---------------- Assertion failed: (isStackValueValid(newval)), function createStackValue, file interpret.c, line 4070. Abort trap ---------------- Test case 2: ---------------- static assert({ int a; *(&a) = 0; return true; }()); ---------------- CTFE internal error: unsupported assignment *& a = 0 Assertion failed: (e1->op == TOKarraylength || e1->op == TOKvar || e1->op == TOKdotvar || e1->op == TOKindex || e1->op == TOKslice), function interpretAssignCommon, file interpret.c, line 2380. Abort trap ---------------- (In 2.052 this simply result in a "cannot evaluate" error, not an ICE.) A related test case of #2 would be ---------------- static assert({ int a, b, c; (c ? a : b) = 1; return true; }()); ---------------- This causes an ICE because (c ? a : b) is rewritten to *(c ? &a : &b).
Comment #1 by kennytm — 2011-06-10T12:45:29Z