May 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6053

           Summary: [CTFE] Two ICEs involving pointers (dereference and
                    assign; pointer variable on stack)
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: kennytm@gmail.com


--- Comment #0 from kennytm@gmail.com 2011-05-24 11:37:43 PDT ---
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).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 10, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6053


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from kennytm@gmail.com 2011-06-10 12:45:29 PDT ---
These codes are actually made CTFE-able. Oh well.

https://github.com/D-Programming-Language/dmd/commit/c1ae91d4149122daeab67fe76a0fe1e77cf30b79

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------