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;
}