← Back to index
|
Original Bugzilla link
Bug 3494 – Segfault(mtype.c) using typeof(return) inside an auto function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2009-11-11T05:21:00Z
Last change time
2015-06-09T01:27:03Z
Keywords
ice-on-invalid-code, patch
Assigned to
nobody
Creator
clugdbug
Comments
Comment #0
by clugdbug — 2009-11-11T05:21:25Z
TEST CASE: --- auto foo() { typeof(return) result; return result; } --- PATCH: TypeReturn::semantic(), mtype.c, line 5236 Type *TypeReturn::semantic(Loc loc, Scope *sc) { Type *t; if (!sc->func) { error(loc, "typeof(return) must be inside function"); goto Lerr; } t = sc->func->type->nextOf(); + if (!t) + { error(loc, "typeof(return) cannot infer type"); + goto Lerr; + } t = t->addMod(mod);
Comment #1
by bugzilla — 2009-12-06T00:54:47Z
Fixed dmd 2.037