Fix writing to freed memory if Interpreter::executeTransaction fails.
This commit is contained in:
parent
120ca522b0
commit
5229194db4
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user