Don't crash when using objc boxed expression with parsing error.
rdar://11426994
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156565 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 0d9a54e..9aca5cd 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -2598,7 +2598,10 @@
ExprResult ValueExpr(ParseAssignmentExpression());
if (T.consumeClose())
return ExprError();
-
+
+ if (ValueExpr.isInvalid())
+ return ExprError();
+
// Wrap the sub-expression in a parenthesized expression, to distinguish
// a boxed expression from a literal.
SourceLocation LPLoc = T.getOpenLocation(), RPLoc = T.getCloseLocation();