Thread overview
[Issue 7583] New: [CTFE] Pushing to Token array results in interpreter assert
Feb 25, 2012
aneas@gmx.net
[Issue 7583] [CTFE] ICE with tuple, alias this, and ~=
Feb 27, 2012
Don
[Issue 7583] [CTFE] ICE with tuple and alias this
Feb 28, 2012
Don
Mar 01, 2012
Walter Bright
February 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7583

           Summary: [CTFE] Pushing to Token array results in interpreter
                    assert
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Keywords: CTFE, ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: aneas@gmx.net


--- Comment #0 from aneas@gmx.net 2012-02-25 06:44:17 PST ---
The following code results in a CTFE error. The bad line is "array_of_tuples ~=
Tuple!(int, int)(0, 0);"


import std.typecons;

void function_evaluated_at_compiletime() {
    Tuple!(int, int)[] array_of_tuples;
    array_of_tuples ~= Tuple!(int, int)(0, 0);
}

void main() {
    mixin(function_evaluated_at_compiletime());
}


$ dmd main.d
dmd: interpret.c:94: Expression* CtfeStack::getValue(VarDeclaration*):
Assertion `v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()'
failed.
Aborted

DMD64 D Compiler v2.058

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7583


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au
            Summary|[CTFE] Pushing to Token     |[CTFE] ICE with tuple,
                   |array results in            |alias this, and ~=
                   |interpreter assert          |


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2012-02-27 12:22:32 PST ---
Reduced test case. Seems to be very complicated.

----------------
template Tup7583(E...) { alias E Tup7583; }

struct S7583
{
    Tup7583!(float, char) field;
    alias field this;
    this(int x) {    }
}


int bug7583() {
    S7583[] arr;
    arr ~= S7583(0);
    return 1;
}

static assert (bug7583());

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 28, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7583


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[CTFE] ICE with tuple,      |[CTFE] ICE with tuple and
                   |alias this, and ~=          |alias this


--- Comment #2 from Don <clugdbug@yahoo.com.au> 2012-02-28 01:41:17 PST ---
This is a front-end bug. Happens with == as well as ~=.
The front-end creates a temporary tuple variable __tup5.
Somehow the declaration of __tup5 gets removed. The ICE is because it's used
before being declared.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7583



--- Comment #3 from github-bugzilla@puremagic.com 2012-02-29 23:58:47 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bcfd90aae05bd6259212ec870b2c037569029d77 Merge pull request #773 from 9rnsr/fix7583

fix Issue 7583 - [CTFE] ICE with tuple and alias this

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7583


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


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