Bug 5978 – ICE(mtype.c) when calling __traits(parent) on the child of an anonymous function.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-05-11T08:45:00Z
Last change time
2013-01-09T17:37:13Z
Keywords
ice
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-05-11T08:45:07Z
Test case: -------------------------------------------- void main() { () { int x; pragma(msg, __traits(parent, x)); } (); } -------------------------------------------- Assertion failed: (next), function toDecoBuffer, file mtype.c, line 4706. Abort trap -------------------------------------------- The relevant stack trace: #5 0x000cf227 in TypeFunction::toDecoBuffer (this=0x343ec0, buf=0xbfffea80, flag=0) at mtype.c:4706 4706 assert(next); #6 0x000d3545 in Type::merge (this=0x3440b0) at mtype.c:1498 1498 toDecoBuffer(&buf); #7 0x000d4242 in Type::pointerTo (this=0x343ec0) at mtype.c:1206 1206 pto = t->merge(); #8 0x0007e3c0 in FuncExp::semantic (this=0x344090, sc=0x343cd0) at expression.c:4758 4758 type = fd->type->pointerTo(); #9 0x00135413 in TraitsExp::semantic (this=0x310690, sc=0x343cd0) at traits.c:384 384 e = e->semantic(sc);
Comment #1 by lovelydear — 2012-04-20T10:33:53Z
Also fails on Win32 2.059
Comment #2 by andrej.mitrovich — 2013-01-08T13:01:03Z
Now works in 2.062 git-head.
Comment #3 by bugzilla — 2013-01-08T15:00:38Z
Comment #4 by github-bugzilla — 2013-01-08T15:05:29Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ff62d9eaee74287928f5b7858ac5b8cbd6496d98 add test case for Issue 5978 - ICE(mtype.c) when calling __traits(parent) on the child of an anonymous function. Issue 5978 - ICE(mtype.c) when calling __traits(parent) on the child of an anonymous function. https://github.com/D-Programming-Language/dmd/commit/15ed69199bde6d857354e6fe439f987fcc570b4c Merge pull request #1444 from WalterBright/test5978 add test case for issue 5978
Comment #5 by k.hara.pg — 2013-01-09T17:37:13Z
In current, dmd test suite has a test case for this bug.