Fix malformed program crash.

This commit is contained in:
Matt Pharr
2012-04-20 11:53:43 -07:00
parent 4dfc596d38
commit cf9a4e209e

View File

@@ -3711,7 +3711,10 @@ ExprList::GetConstant(const Type *type) const {
// expression to the type we need, then let the regular type // expression to the type we need, then let the regular type
// conversion machinery handle it. // conversion machinery handle it.
expr = TypeConvertExpr(exprs[i], elementType, "initializer list"); expr = TypeConvertExpr(exprs[i], elementType, "initializer list");
Assert(expr != NULL); if (expr == NULL) {
Assert(m->errorCount > 0);
return NULL;
}
// Re-establish const-ness if possible // Re-establish const-ness if possible
expr = ::Optimize(expr); expr = ::Optimize(expr);
} }