[cfe-commits] r121452 - /cfe/trunk/lib/Sema/SemaExpr.cpp

John McCall rjmccall at apple.com
Thu Dec 9 17:49:45 PST 2010


Author: rjmccall
Date: Thu Dec  9 19:49:45 2010
New Revision: 121452

URL: http://llvm.org/viewvc/llvm-project?rev=121452&view=rev
Log:
Bind the result of a property fetch to a temporary.


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

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=121452&r1=121451&r2=121452&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Dec  9 19:49:45 2010
@@ -7035,6 +7035,10 @@
 
   E = ImplicitCastExpr::Create(Context, E->getType(), CK_GetObjCProperty,
                                E, 0, VK);
+  
+  ExprResult Result = MaybeBindToTemporary(E);
+  if (!Result.isInvalid())
+    E = Result.take();
 }
 
 void Sema::ConvertPropertyForLValue(Expr *&LHS, Expr *&RHS, QualType &LHSTy) {





More information about the cfe-commits mailing list