[Issue 4238] New: Segfault(statement.c): with(typeof(int))
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed May 26 13:03:04 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4238
Summary: Segfault(statement.c): with(typeof(int))
Product: D
Version: 1.020
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: ice-on-invalid-code, patch
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: clugdbug at yahoo.com.au
--- Comment #0 from Don <clugdbug at yahoo.com.au> 2010-05-26 13:03:03 PDT ---
TEST CASE:
-----
void bug4237()
{
int s;
with(typeof(s)) {}
}
----
PATCH (D2 svn 502):
// WithStatement::semantic. line 3639: segfaults because toDsymbol(sc)
// returns null.
{ TypeExp *es = (TypeExp *)exp;
- sym = es->type->toDsymbol(sc)->isScopeDsymbol();
+ Dsymbol *dsym = es->type->toDsymbol(sc);
+ sym = dsym ? dsym->isScopeDsymbol() : NULL;
if (!sym)
{ error("%s has no members", es->toChars());
body = body->semantic(sc);
return this;
}
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list