www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13588] New: ICE at comparison [0] == 0

https://issues.dlang.org/show_bug.cgi?id=13588

          Issue ID: 13588
           Summary: ICE at comparison [0] == 0
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: valeriy.fedotov gmail.com

Created attachment 1444
  --> https://issues.dlang.org/attachment.cgi?id=1444&action=edit
This code leads to ICE.

int correctBigNum(short[] x)
{
    if (x.length == 0 && [0] == 0) {
        return true;
    }
    foreach(i; 0..x.length) {
        if (x[i] <= 0 || x[i] >= 10000) {
            return false;
        }
    }
    return true;
}

compiling this code leads to message

Internal error: e2ir.c 1910

(in the last 2.067.0-b1 in stable 2.066 the error is also present, but line
number in e2ir is different.)

As you should note, I just for forgot to insert x before [0] in the first line
of function body.

--
Oct 08 2014