www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9445] New: interpret.c:151: Assertion `v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()' failed.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9445

           Summary: interpret.c:151: Assertion `v->ctfeAdrOnStack >= 0 &&
                    v->ctfeAdrOnStack < stackPointer()' failed.
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Keywords: CTFE, ice
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: Marco.Leise gmx.de


--- Comment #0 from Marco Leise <Marco.Leise gmx.de> 2013-02-02 22:57:46 PST ---
I don't know how to describe the error, but here is some reduced code that
provokes the error in DMD 2.061:

--- Vector.d ---

import Rotate;
import Scale;

struct SVector(T)
{
    this(T) {}
    ref opOpAssign(string op)(T) {}
    ref opOpAssign(string op)(SScale!T) {}
    void foo() { this *= 1.0; }
}

struct SNormal(T)
{
    this(SVector!T) { SVector!T().foo; }
}

--- Scale.d ---

import Vector;

struct SScale(T)
{
    auto aaa = SVector!T(1.0);
}

--- Rotate.d ---

import Vector;

struct SRotate(T)
{
    this()(int) {}
    this()(char)
    {
        SRotate!T(0);
        SNormal!T aaa = SVector!T();
    }
}

auto bbb = SRotate!(float)('A');

----------------

Compiled with "dmd Vector.d"

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 02 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9445


callumenator gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |callumenator gmail.com


--- Comment #1 from callumenator gmail.com 2013-03-03 16:51:45 PST ---
Another trigger, DMD 2.062:

import std.traits, std.typecons;

void bug(E)(lazy E expr) 
{
   alias ReturnType!expr RT;
}

void main()
{
   bug(RefCounted!int(0));
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 03 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9445



--- Comment #2 from Don <clugdbug yahoo.com.au> 2013-04-08 02:56:45 PDT ---
The original test case works for me in 2.062.
Reduced test case for comment 1:

template c9445(T...)
{
    static assert(is(typeof( & T[0].xxx )));
}

void bug9445(void delegate() expr)   
{
    static assert( c9445!( expr() ) );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9445



--- Comment #3 from github-bugzilla puremagic.com 2013-04-08 05:19:05 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b3dc0e56eab752fdefc9b591bba6523601514bd2
Fix issue 9445 ICE(interpret.c) calling parameter in CTFE

Typo: should be checking variable has a value, not getting the value
(which will ICE if it has no value).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9445


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |yebblies gmail.com
         OS/Version|Linux                       |All


--- Comment #4 from yebblies <yebblies gmail.com> 2013-04-08 22:36:26 EST ---
Fixed for D2.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9445



--- Comment #5 from github-bugzilla puremagic.com 2013-04-18 11:23:14 PDT ---
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fc4aae260f2ee92b652680adc8f1f933c43d1ffd
Fix issue 9445 ICE(interpret.c) calling parameter in CTFE

Typo: should be checking variable has a value, not getting the value
(which will ICE if it has no value).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 18 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9445


Don <clugdbug yahoo.com.au> changed:

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


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