www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13434] New: [ICE] indexing array with empty tuple causes dmd

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

          Issue ID: 13434
           Summary: [ICE] indexing array with empty tuple causes dmd
                    segfault
           Product: D
           Version: unspecified
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

Code:
------
alias tuple(A...) = A;
void main() {
        float[] arr;
        arr[tuple!()] = 0.0;
}
------

Indexing with a tuple of 1 integral element works correctly, and indexing with
a tuple of more than 1 element correctly generates an error message about
non-convertibility to ulong.

Indexing with an empty tuple should also generate an error message, rather than
crash.

--
Sep 06 2014