[cfe-commits] r86485 - /cfe/trunk/lib/Sema/SemaExprCXX.cpp

Eli Friedman eli.friedman at gmail.com
Sun Nov 8 14:15:39 PST 2009


Author: efriedma
Date: Sun Nov  8 16:15:39 2009
New Revision: 86485

URL: http://llvm.org/viewvc/llvm-project?rev=86485&view=rev
Log:
Fix use-after-free bug.


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

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=86485&r1=86484&r2=86485&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sun Nov  8 16:15:39 2009
@@ -424,14 +424,13 @@
   Expr **ConsArgs = (Expr**)ConstructorArgs.get();
   const RecordType *RT;
   unsigned NumConsArgs = ConstructorArgs.size();
-  
+  ASTOwningVector<&ActionBase::DeleteExpr> ConvertedConstructorArgs(*this);
+
   if (AllocType->isDependentType() || 
       Expr::hasAnyTypeDependentArguments(ConsArgs, NumConsArgs)) {
     // Skip all the checks.
   } else if ((RT = AllocType->getAs<RecordType>()) &&
              !AllocType->isAggregateType()) {
-    ASTOwningVector<&ActionBase::DeleteExpr> ConvertedConstructorArgs(*this);
-
     Constructor = PerformInitializationByConstructor(
                       AllocType, move(ConstructorArgs),
                       TypeLoc,





More information about the cfe-commits mailing list