aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-11-08 22:15:39 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-11-08 22:15:39 +0000
commita8ce9ecae8670fe8e189755b14d73fd84087e51f (patch)
tree5cda1c107a6c39f21061c9975b955b45ec8af3cd
parent7033d61aad0de0feceb3a425dc8da3ab86c7db16 (diff)
Fix use-after-free bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86485 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExprCXX.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 4188905fdd..94550e6f19 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -424,14 +424,13 @@ Sema::BuildCXXNew(SourceLocation StartLoc, bool UseGlobal,
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,