The compare/store state can trigger deserialization.

This commit is contained in:
Vassil Vassilev 2013-10-09 15:26:04 +02:00 committed by sftnight
parent 45e42d1156
commit 98c6a9d5bc

View File

@ -312,6 +312,8 @@ namespace cling {
}
void Interpreter::storeInterpreterState(const std::string& name) const {
// This may induce deserialization
PushTransactionRAII RAII(this);
ClangInternalState* state
= new ClangInternalState(getCI()->getASTContext(), name);
m_StoredStates.push_back(state);
@ -320,6 +322,8 @@ namespace cling {
void Interpreter::compareInterpreterState(const std::string& name) const {
ClangInternalState* state
= new ClangInternalState(getCI()->getASTContext(), name);
// This may induce deserialization
PushTransactionRAII RAII(this);
for (unsigned i = 0, e = m_StoredStates.size(); i != e; ++i) {
if (m_StoredStates[i]->getName() == name) {
state->compare(*m_StoredStates[i]);