Bug 8861 – ICE(cgcs.c) 343

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-21T01:35:00Z
Last change time
2013-10-01T23:41:17Z
Keywords
ice
Assigned to
nobody
Creator
hotcocoamix

Comments

Comment #0 by hotcocoamix — 2012-10-21T01:35:20Z
I think it should be informed as " width(height) can not return lvalue. " dmd(2.060) returned " Internal error: ../ztc/cgcs.c 343 " the example is follows: class C{ private int[2] mysize; // The wrong spelling of "mysize". // but is not error but crash. auto ref width(){ return this.size[0]; } auto ref height(){ return this.size[1]; } // getter and setter @property{ int[2] size(){ return this.mysize; } int[2] size( in int[2] xy ){ this.mysize = xy; return xy; } } }
Comment #1 by andrej.mitrovich — 2012-10-21T13:35:15Z
Interesting, only seems to happen when array is length 2 or less: OK: int[3] mysize; @property auto size() { return mysize; } int width() { return size[0]; } void main() { } FAIL: int[2] mysize; @property auto size() { return mysize; } int width() { return size[0]; } void main() { } I've changed the title to make it more searchable for others. High priority since ICEs are important.
Comment #2 by andrej.mitrovich — 2013-01-02T17:15:30Z
New test-case, the error message seems to suggest it's related (line numbers are similar): struct S { ~this() { } } mixin template templ() { auto s = S(); } void main() { mixin templ; }
Comment #3 by andrej.mitrovich — 2013-01-02T17:15:52Z
(In reply to comment #2) > New test-case, the error message seems to suggest it's related (line numbers > are similar): And error: Internal error: ..\ztc\cgcs.c 344
Comment #4 by bugzilla — 2013-10-01T23:41:17Z
I cannot reproduce this with dmd 2.063 or later.