diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-15 18:34:15 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-15 18:34:15 +0000 |
commit | db546fa2ce65dd2e275fc3fdee961767d53f77cf (patch) | |
tree | d976dd50f55eb39691cc52c264f58ceab1f1df91 /lib/Sema/SemaExprObjC.cpp | |
parent | 820b23dc924a4ae7af07d5a75d6b1d781c267d57 (diff) |
Fix crash-on-invalid where a ParenListExpr shows up as a message receiver
while trying to do error recovery.
rdar://13207886
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175282 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 7f0c832575..76ee983712 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -2485,6 +2485,13 @@ ExprResult Sema::ActOnInstanceMessage(Scope *S, MultiExprArg Args) { if (!Receiver) return ExprError(); + + // A ParenListExpr can show up while doing error recovery with invalid code. + if (isa<ParenListExpr>(Receiver)) { + ExprResult Result = MaybeConvertParenListExprToParenExpr(S, Receiver); + if (Result.isInvalid()) return ExprError(); + Receiver = Result.take(); + } if (RespondsToSelectorSel.isNull()) { IdentifierInfo *SelectorId = &Context.Idents.get("respondsToSelector"); |