Thread overview
[Issue 9938] New: ICE using global interface variable in CTFE
Apr 16, 2013
Don
Apr 17, 2013
Walter Bright
Jun 02, 2013
Henning Pohl
April 16, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9938

           Summary: ICE using global interface variable in CTFE
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: clugdbug@yahoo.com.au


--- Comment #0 from Don <clugdbug@yahoo.com.au> 2013-04-16 04:57:31 PDT ---
The new tests for CTFE class variables cause an assert failure if run at compile time.

dmd: interpret.c:164: Expression* CtfeStack::getValue(VarDeclaration*):
Assertion `v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < globalValues.dim'
failed.
Aborted

======

diff --git a/test/runnable/interpret.d b/test/runnable/interpret.d index 38735e6..53fbe1f 100644
--- a/test/runnable/interpret.d
+++ b/test/runnable/interpret.d
@@ -2871,7 +2871,7 @@ const ITest105a t105ia = new Test105b('E', 88, 'A', 99);
 __gshared Test105b t105gs = new Test105b('E', 88, 'A', 99);
 shared Test105b t105bs = new shared(Test105b)('E', 88, 'A', 99);
 immutable Test105b t105bi = new immutable(Test105b)('E', 88, 'A', 99);
-void test105()
+bool test105()
 {
     assert(t105b.a == 'A');
     assert(t105b.b == 99);
@@ -2920,9 +2920,11 @@ void test105()
     assert(t105bi.f == 88);
     assert(t105bi.test105a() == "test105a");
     assert(t105bi.test105b() == "test105b");
-
+    return true;
 }

+static assert(test105());
+

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9938


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2013-04-17 14:02:39 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1906

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9938



--- Comment #2 from github-bugzilla@puremagic.com 2013-04-17 14:03:12 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/de3a12435a92b6309ab11684c149eb527e458b75 Fix issue 9938 ICE using global interface variable in CTFE

Can't just use getValue() to get the value of the 'this', it might
be a global.

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


Henning Pohl <henning@still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |henning@still-hidden.de
         Resolution|                            |FIXED


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