Bug 2603 – ICE(cgcs.c) on subtracting string literals

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2009-01-22T11:17:00Z
Last change time
2014-03-01T00:36:31Z
Keywords
accepts-invalid, ice-on-invalid-code, patch, wrong-code
Assigned to
bugzilla
Creator
tomas

Comments

Comment #0 by tomas — 2009-01-22T11:17:12Z
module foobar; void main() { char[] c = "a" - "b"; } // $ dmd foobar.d // Internal error: ../ztc/cgcs.c 358
Comment #1 by clugdbug — 2009-05-05T16:33:53Z
The string literal case doesn't segfault on D2.029, it generates wrong code instead. But a related case also segfaults (still in ..\backend\cgcs.c 358) on D1 and D2. void main() { auto c = [1,2,3]-[1,2,3]; } --- PATCH(e2ir.c, line 1955), in elem *MinExp::toElem(IRState *irs) just copy code from AddExp::toElem(IRState *irs), changing OPadd into OPmin on the last line.
Comment #2 by bugzilla — 2009-07-09T02:47:36Z
Fixed dmd 1.046 and 2.031