Summary: DMD crashes on foreach of undefined identifier
           Product: D
           Version: 2.023
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD

void main() {
    foreach (element; undef) {

void fn(int i) {}
C:\Users\Stewart\Documents\Programming\D\Tests\bugs>dmd foreach_undef.d
foreach_undef.d(2): Error: undefined identifier undef
foreach_undef.d(2): Error: foreach: int is not an aggregate type
followed by a Windows application failure dialog, showing the details:
Problem signature:
  Problem Event Name:   APPCRASH
  Application Name:     dmd.exe
  Application Version:
  Application Timestamp:        00000000
  Fault Module Name:    dmd.exe
  Fault Module Version:
  Fault Module Timestamp:       00000000
  Exception Code:       c0000005
  Exception Offset:     0001ccec
  OS Version:   6.0.6001.
  Locale ID:    2057
  Additional Information 1:     64bb
  Additional Information 2:     a42ac0f0b295811241a2caffb74a0ff1
  Additional Information 3:     b17c
  Additional Information 4:     af2368a443111b924ca617c6f294878c

Read our privacy statement:

Specifying the type of element makes no difference.  If element is unused
inside the for loop, the crash disappears.


Reply via email to