www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22390] New: Compiler crash when iterating empty array of


          Issue ID: 22390
           Summary: Compiler crash when iterating empty array of bottom
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: Ajieskola gmail.com

These both cause a compiler crash on latest master:

int main()
{ noreturn[] empty;
  int val;
  foreach(el; empty) val++;
  return val;

int main()
{ noreturn[] empty;
  return empty == empty;

Also tested the latter on 2.097.2, which crashes too.

Issue 21956 is likely to be related.

Oct 15 2021