Bug 6799 – ICE(type.c) involving AAs and pointers to structs

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-10-09T23:22:00Z
Last change time
2013-10-08T21:48:55Z
Keywords
ice
Assigned to
nobody
Creator
debio264

Comments

Comment #0 by debio264 — 2011-10-09T23:22:29Z
Code Sample: struct ChunkLoc { } class Chunk { private ChunkLoc _loc; @property public ChunkLoc loc() { return _loc; } } private struct FiberWaitingForChunk { } class WorldCache { FiberWaitingForChunk*[ChunkLoc] _fibersWaitingForChunks; void chunkLoaded(Chunk chunk) { _fibersWaitingForChunks.remove(chunk.loc); } } Output: Internal error: backend/type.c 304 (Code doesn't make much sense because it's a very reduced scenario) (Kudos to DustMite)
Comment #1 by code — 2012-02-19T22:56:36Z
Any progress on this? Still happening with dmd 2.058 on windows.
Comment #2 by code — 2012-02-20T09:13:53Z
This only seems to happen when passing a struct to remove by value. If you pass it by reference everything is fine. Reduced repro case + workaround: struct ChunkLoc {} ChunkLoc Get() { return ChunkLoc(); } int main(string[] args) { int[ChunkLoc] aa; aa.remove(Get()); //workaround //auto value = Get(); //aa.remove(value); return 0; }
Comment #3 by bugzilla — 2013-10-05T21:09:10Z
Comment #4 by github-bugzilla — 2013-10-08T21:26:44Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1709042d8650a8550882e5c553a4a9b5fb79148f fix Issue 6799 - ICE(type.c) involving AAs and pointers to structs https://github.com/D-Programming-Language/dmd/commit/16e678b2c9a7c71e0701e9d945c1f5fdde7c10fb Merge pull request #2633 from WalterBright/fix6799 fix Issue 6799 - ICE(type.c) involving AAs and pointers to structs