From: Fariborz Jahanian Date: Mon, 15 Sep 2014 21:19:39 +0000 (+0000) Subject: Objective-C. Prevents a crash generating AST for a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc357ac9dba1b08589867405dacb0ca2ebd2f736;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217825 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp index 7bfe333749..5e92d5d07c 100644 --- a/lib/Sema/SemaPseudoObject.cpp +++ b/lib/Sema/SemaPseudoObject.cpp @@ -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(RHS)) + return ExprError(); Expr *syntacticLHS = rebuildAndCaptureObject(LHS); OpaqueValueExpr *capturedRHS = capture(RHS);