Since the object is new'ed in the enterCFG function, now deleting in the exitCFG function instead of the destructor to ensure proper pairing. This allows reuse of the builder without creating a memory leak.

llvm-svn: 206471
This commit is contained in:
Aaron Ballman 2014-04-17 15:23:50 +00:00
parent 664b1e2f9b
commit ed5aced64e
2 changed files with 1 additions and 4 deletions

View File

@ -227,10 +227,6 @@ public:
SelfVar = new (Arena)til::Variable(til::Variable::VK_SFun);
}
~SExprBuilder() {
delete CallCtx;
}
// Translate a clang statement or expression to a TIL expression.
// Also performs substitution of variables; Ctx provides the context.
// Dispatches on the type of S.

View File

@ -597,6 +597,7 @@ void SExprBuilder::exitCFG(const CFGBlock *Last) {
CurrentBlockID = 0;
CurrentVarID = 0;
CurrentArgIndex = 0;
delete CallCtx;
}