]> granicus.if.org Git - clang/commitdiff
Objective-C. Prevents a crash generating AST for a
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 15 Sep 2014 21:19:39 +0000 (21:19 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 15 Sep 2014 21:19:39 +0000 (21:19 +0000)
a property assignment due to numerous user errors.
Cannot come up with a reasonable test case due to
array of user errors before the crash point.
rdar://17813651.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217825 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaPseudoObject.cpp

index 7bfe3337494666e6f3719b0947f0f9c27e09f6b0..5e92d5d07c51a08c52143b6b2b118ef3492efd58 100644 (file)
@@ -406,6 +406,10 @@ PseudoOpBuilder::buildAssignmentOperation(Scope *Sc, SourceLocation opcLoc,
                                           BinaryOperatorKind opcode,
                                           Expr *LHS, Expr *RHS) {
   assert(BinaryOperator::isAssignmentOp(opcode));
+  
+  // Recover from user error
+  if (isa<UnresolvedLookupExpr>(RHS))
+    return ExprError();
 
   Expr *syntacticLHS = rebuildAndCaptureObject(LHS);
   OpaqueValueExpr *capturedRHS = capture(RHS);