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.

llvm-svn: 217825
This commit is contained in:
Fariborz Jahanian 2014-09-15 21:19:39 +00:00
parent b67140b812
commit df91c927e8
1 changed files with 4 additions and 0 deletions

View 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);