From cf9a4e209ee99df8eefe087fb898925e0cf28164 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Fri, 20 Apr 2012 11:53:43 -0700 Subject: [PATCH] Fix malformed program crash. --- expr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/expr.cpp b/expr.cpp index 01339d03..0b992ddc 100644 --- a/expr.cpp +++ b/expr.cpp @@ -3711,7 +3711,10 @@ ExprList::GetConstant(const Type *type) const { // expression to the type we need, then let the regular type // conversion machinery handle it. 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 expr = ::Optimize(expr); }