Bug 1702 – ICE when identifier is undefined

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2007-11-30T05:41:00Z
Last change time
2015-06-09T01:14:34Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
gide

Comments

Comment #0 by gide — 2007-11-30T05:41:17Z
hello.d ------- void main() { string a = "Hello " ~ unknownVariable; } $ dmd hello.d hello.d(2): Error: undefined identifier unknownVariable hello.d(2): Error: incompatible types for (("Hello ") ~ (unknownVariable)): 'invariant(char[6u])' and 'int' Segmentation fault
Comment #1 by spam — 2007-11-30T12:39:37Z
i stumbled upon this one also quite often. its more because of the concat operator i think, cause a simple expression a = unknown; doesnt crash.
Comment #2 by gide — 2007-12-04T05:58:27Z
Agreed, I think concat operator looks like the issue, the following code also seg faults the compiler. void main() { string a = "Hello " ~ 10; } $ dmd hello.d hello.d(4): Error: incompatible types for (("Hello ") ~ (10)): 'invariant(char[6u])' and 'int' Segmentation fault
Comment #3 by bugzilla — 2008-01-02T19:49:29Z
Fixed dmd 2.009
Comment #4 by gide — 2008-09-10T04:48:50Z
Broken in dmd 2.012 onwards.
Comment #5 by clugdbug — 2009-04-14T04:57:17Z
*** Bug 1916 has been marked as a duplicate of this bug. ***
Comment #6 by clugdbug — 2009-04-14T07:00:26Z
This works for me on DMD2.028.