Fix use-after-free bug.

llvm-svn: 86485
This commit is contained in:
Eli Friedman 2009-11-08 22:15:39 +00:00
parent 2edf3a4896
commit fd8d4e1383
1 changed files with 2 additions and 3 deletions

View File

@ -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,