Thread overview
[Issue 4949] New: ICE on invalid static if using value of 'this'
Sep 27, 2010
Iain Buclaw
Sep 27, 2010
Iain Buclaw
Oct 08, 2010
Walter Bright
September 27, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4949

           Summary: ICE on invalid static if using value of 'this'
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: ibuclaw@ubuntu.com


--- Comment #0 from Iain Buclaw <ibuclaw@ubuntu.com> 2010-09-27 10:29:25 PDT ---
Created an attachment (id=777)
catch functions returning CANT_INTEPRET_EXP

testcase:

class A
{
    bool delegate() dg;
    void B()
    {
        static if ( dg() )
            should error graciously;
    }
}

Produces:
ice.d(6): Error: value of 'this' is not known at compile time
Segmentation fault (core dumped)

Catching it in gdb, occurs in interpret.c at CallExp::interpret, around line 2720. A few assignments, no checking whether or not any returned EXP_CANT_INTERPRET.

Currently rebuilding using the attached change...

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


Iain Buclaw <ibuclaw@ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Iain Buclaw <ibuclaw@ubuntu.com> 2010-09-27 10:38:40 PDT ---
Tested, I now get:

ice.d(6): Error: value of 'this' is not known at compile time
ice.d(6): Error: expression this.dg() is not constant or does not evaluate to a
bool


Which is correct, and fixes the ICE.

Regards

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 08, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4949


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2010-10-08 14:12:57 PDT ---
http://www.dsource.org/projects/dmd/changeset/710

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