Bug 10016 – Incorrect error gagging using RefCounted

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-30T08:44:00Z
Last change time
2013-05-11T13:19:42Z
Keywords
ice, pull
Assigned to
nobody
Creator
henning

Comments

Comment #0 by henning — 2013-04-30T08:44:17Z
struct RefCounted(T) { struct RefCountedStore { struct Impl { T _payload; } Impl* _store; } RefCountedStore _refCounted; void opAssign(typeof(this)) { } void opAssign(T) { } @property refCountedPayload() { return _refCounted._store._payload; } alias refCountedPayload this; } struct S { int i = malloc; } class C { } class N { this(C) { } C c() { return null; } } class D : N { this() { super(c); } RefCounted!S _s; } 2.063: ----- Fatal Error: Out of memory ----- 2.062: ----- main.d(22): Error: undefined identifier malloc main.d(42): Error: template instance main.RefCounted!(S) error instantiating ----- DustMite did a good job :]
Comment #1 by henning — 2013-04-30T09:43:35Z
You can replace malloc with someRandomUnknownIdentifier.
Comment #2 by k.hara.pg — 2013-05-08T20:42:38Z
https://github.com/D-Programming-Language/dmd/pull/1983 With git head(75d3660), "Out of memory" error does not occur. Instead, the OP code reports no error with -o- switch (different from 2.062), and cause "Internal error: backend\dt.c 106" with -c switch. AFAICS this is a front-end issue. the code should report "undefined identifier" error as same as 2.062, but the error is incorrectly gagged.
Comment #3 by github-bugzilla — 2013-05-10T12:31:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b05f00b820a3385978e1d0e03f75dbf6a06f6783 fix Issue 10016 - Incorrect error gagging using RefCounted https://github.com/D-Programming-Language/dmd/commit/ba2cf258728ec23ecc216ad156868c3934282bac Merge pull request #1983 from 9rnsr/fix10016 [REG2.063a] Issue 10016 - Incorrect error gagging using RefCounted
Comment #4 by k.hara.pg — 2013-05-11T08:42:13Z
Compiler fix is now merged, and incorrect error gagging issue is fixed. But, I cannot still confirm that the original "Out of memory" error. Henning, could you please check your code with git head. If the original issue is really fixed, close this issue.
Comment #5 by henning — 2013-05-11T13:19:42Z
It works now, good job. Reverting your commit leads to Out Of Memory again. But why do you get an ICE? I'm on Linux x64.