r217825 - Objective-C. Prevents a crash generating AST for a

Fariborz Jahanian fjahanian at apple.com
Mon Sep 15 14:19:40 PDT 2014


Author: fjahanian
Date: Mon Sep 15 16:19:39 2014
New Revision: 217825

URL: http://llvm.org/viewvc/llvm-project?rev=217825&view=rev
Log:
Objective-C. Prevents a crash generating AST for a
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.

Modified:
    cfe/trunk/lib/Sema/SemaPseudoObject.cpp

Modified: cfe/trunk/lib/Sema/SemaPseudoObject.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaPseudoObject.cpp?rev=217825&r1=217824&r2=217825&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaPseudoObject.cpp (original)
+++ cfe/trunk/lib/Sema/SemaPseudoObject.cpp Mon Sep 15 16:19:39 2014
@@ -406,6 +406,10 @@ PseudoOpBuilder::buildAssignmentOperatio
                                           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);





More information about the cfe-commits mailing list