[cfe-commits] r138616 - /cfe/trunk/lib/Sema/SemaExprObjC.cpp

John McCall rjmccall at apple.com
Thu Aug 25 17:48:42 PDT 2011


Author: rjmccall
Date: Thu Aug 25 19:48:42 2011
New Revision: 138616

URL: http://llvm.org/viewvc/llvm-project?rev=138616&view=rev
Log:
Be sure to do unary conversions on the operand to an ARC
bridged cast.  Noticed by AST inspection by Ted Kremenek!


Modified:
    cfe/trunk/lib/Sema/SemaExprObjC.cpp

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=138616&r1=138615&r2=138616&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Thu Aug 25 19:48:42 2011
@@ -1820,6 +1820,10 @@
                                       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();
 





More information about the cfe-commits mailing list