[Issue 9982] New: ICE on CTFE for pointer dereference

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 23 03:23:13 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9982

           Summary: ICE on CTFE for pointer dereference
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: CTFE, ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-04-23 03:23:13 PDT ---
Assertion failure: 'dest->op == TOKstructliteral || dest->op == TOKarrayliteral
|| dest->op == TOKstring' on line 1604 in file 'ctfeexpr.c'

and

Error: cannot dereference invalid pointer *chunk

//----------------
static struct S
{
}
struct SS
{
    S s2; //[1]
    this(S s1)
    {
        //S s2; //[2]
        emplace(&s2, s1);
    }
}

void emplace(S* chunk, S arg)
{
    emplacePostblitter(*chunk, arg); //[3]
    *chunk = arg; //[4]
}
private void emplacePostblitter(ref S chunk, S arg)
{
    chunk = arg;
}

enum s = S();
enum p = SS(s);
//----------------

Getting two different errors:
[3] : //Assertion failure: 'dest->op == TOKstructliteral || dest->op ==
TOKarrayliteral || dest->op == TOKstring' on line 1604 in file 'ctfeexpr.c'

If we comment [3], then it is [4] that errors:
[4] Error: cannot dereference invalid pointer *chunk

Interesting enough, if we move line [1] to line [2], then everything works
fine.

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


More information about the Digitalmars-d-bugs mailing list