Thread overview
[Issue 10949] New: CTFE ICE after indexing error
Sep 02, 2013
Don
Sep 02, 2013
Walter Bright
September 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10949

           Summary: CTFE ICE after indexing error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: clugdbug@yahoo.com.au


--- Comment #0 from Don <clugdbug@yahoo.com.au> 2013-09-01 23:21:02 PDT ---
In the compiler, any call to optimize() may create an ErrorExp, if an array bounds error occurs. This error is currently not propagated by any of the optimize() functions. If this optimized expression is passed to CTFE, the CTFE check for AST validity will fail.

Here's a single static assert which tests 14 cases.

int global;
static assert((((((([5,5][3] + global -
global)*global/global%global)>>global)&global|global)^global) == 9, [2,3][17])
|| ([3,3,3][9] is 4) && ([[1,2,3]][4]).length);

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



--- Comment #1 from github-bugzilla@puremagic.com 2013-09-01 23:45:15 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4a0f6cca0ade3fdc7e5dc50e8b537db081301028 Fix issue 10949 CTFE ICE after indexing error

When an error occurs during optimize(), propagate the ErrorExp.

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


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: -------