From: John McCall Date: Fri, 26 Aug 2011 00:48:42 +0000 (+0000) Subject: Be sure to do unary conversions on the operand to an ARC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4906cf97fb6b7aebf5b1b8b99762f0f8fe1f15ea;p=clang Be sure to do unary conversions on the operand to an ARC bridged cast. Noticed by AST inspection by Ted Kremenek! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138616 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index f3893ce2a5..db5de4ca9c 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1820,6 +1820,10 @@ ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *SubExpr) { + ExprResult SubResult = UsualUnaryConversions(SubExpr); + if (SubResult.isInvalid()) return ExprError(); + SubExpr = SubResult.take(); + QualType T = TSInfo->getType(); QualType FromType = SubExpr->getType();