Fix writing to freed memory if Interpreter::executeTransaction fails.

This commit is contained in:
Frederich Munch 2017-03-21 01:00:27 -04:00 committed by sftnight
parent 120ca522b0
commit 5229194db4

View File

@ -508,10 +508,12 @@ namespace cling {
if (!T->getParent()) {
if (m_Interpreter->executeTransaction(*T)
>= Interpreter::kExeFirstError) {
// Roll back on error in initializers
//assert(0 && "Error on inits.");
// Roll back on error in initializers.
// T maybe pointing to freed memory after this call:
// Interpreter::unload
// IncrementalParser::deregisterTransaction
// TransactionPool::releaseTransaction
m_Interpreter->unload(*T);
T->setState(Transaction::kRolledBackWithErrors);
return;
}
}