www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10949] New: CTFE ICE after indexing error

reply d-bugmail puremagic.com writes:
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



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: -------
Sep 01 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10949




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: -------
Sep 01 2013
prev sibling parent d-bugmail puremagic.com writes:
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: -------
Sep 01 2013