Merged DMD commit 1e391e49c2d8ec6fa3aaa9d273efad201b757302:

bugzilla 4938 Regression(2.047) dmd segfault when compiling
This commit is contained in:
David Nadlinger
2011-04-22 14:57:14 +02:00
parent 85ff3e6fc0
commit 55315f59ef

View File

@@ -4119,7 +4119,12 @@ void Catch::semantic(Scope *sc)
type = new TypeIdentifier(0, Id::Object);
type = type->semantic(loc, sc);
if (!type->toBasetype()->isClassHandle())
error(loc, "can only catch class objects, not '%s'", type->toChars());
{
if (type != Type::terror)
{ error(loc, "can only catch class objects, not '%s'", type->toChars());
type = Type::terror;
}
}
else if (ident)
{
var = new VarDeclaration(loc, type, ident, NULL);