Allow unloading of Transactions that have not been committed:

If Lookup fails to instantiate, its transaction should not be committed,
as we know it's useless and must be unloaded as it might contain invalid
Decls.
But that means Lookup needs to unload a non-committed transaction.
This commit is contained in:
Axel Naumann 2020-12-18 17:02:55 +01:00 committed by jenkins
parent 2fc0a3c5c4
commit e66ea9ad58

View File

@ -697,11 +697,18 @@ namespace cling {
Parent->removeNestedTransaction(&T);
T.setParent(0);
} else {
// Remove from the queue
assert(&T == m_Transactions.back() && "Out of order transaction removal");
m_Transactions.pop_back();
if (!m_Transactions.empty())
m_Transactions.back()->setNext(0);
if (&T == m_Transactions.back()) {
// Remove from the queue
m_Transactions.pop_back();
if (!m_Transactions.empty())
m_Transactions.back()->setNext(0);
} else {
// If T is not the last transaction it must not be a previous
// transaction either, but a "disconnected" one, i.e. one that
// was not yet committed.
assert(std::find(m_Transactions.begin(), m_Transactions.end(), &T)
== m_Transactions.end() && "Out of order transaction removal");
}
}
m_TransactionPool->releaseTransaction(&T);