]> granicus.if.org Git - clang/commitdiff
Be sure to do unary conversions on the operand to an ARC
authorJohn McCall <rjmccall@apple.com>
Fri, 26 Aug 2011 00:48:42 +0000 (00:48 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 26 Aug 2011 00:48:42 +0000 (00:48 +0000)
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

lib/Sema/SemaExprObjC.cpp

index f3893ce2a587280475e000248c20cf3a92e3cfe2..db5de4ca9c0d196d323f98fc145712c6e061242e 100644 (file)
@@ -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();