Bug 9315 – ICE (expression.c:4249, StructLiteralExp::getField) Tupleof of nested struct literal

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-14T00:07:00Z
Last change time
2013-01-31T16:48:21Z
Keywords
ice, pull
Assigned to
nobody
Creator
maxim

Comments

Comment #0 by maxim — 2013-01-14T00:07:54Z
auto foo() { struct S { int i; void bar() { } } pragma(msg, S.init.tupleof[$-1]); } void main() { } dmd 2.061 (actually fresh from git head); dmd: expression.c:4249: Expression* StructLiteralExp::getField(Type*, unsigned int): Assertion `i < elements->dim' failed. Aborted
Comment #1 by maxim — 2013-01-14T00:10:26Z
Moving struct definition outside function does not result in crash.
Comment #2 by yebblies — 2013-01-14T05:57:12Z
I get: DMD v2.062 DEBUG Assertion failure: 'index < dim' on line 318 in file 'root\root.h'
Comment #3 by maxim — 2013-01-14T07:42:16Z
(In reply to comment #2) > I get: > > DMD v2.062 DEBUG > Assertion failure: 'index < dim' on line 318 in file 'root\root.h' I updated my dmd to today version, and still receive original message. It happens on linux 64 bit.
Comment #4 by k.hara.pg — 2013-01-21T15:01:34Z
Comment #5 by github-bugzilla — 2013-01-31T12:01:42Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/14e78697f3fd2d59c5b0bd9038c7bbf98c4c8048 fix Issue 9315 - ICE (expression.c:4249, StructLiteralExp::getField) Tupleof of nested struct literal https://github.com/D-Programming-Language/dmd/commit/5d38cde2e48f2149cd307cfc283d38b13ebd2c06 Merge pull request #1529 from 9rnsr/fix9315 Issue 9315 - ICE (expression.c:4249, StructLiteralExp::getField) Tupleof of nested struct literal