3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 04:28:17 +00:00

hardening pop abuse and exception safety for #1776

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-07-30 09:56:16 -07:00
parent 13390e2c3a
commit fdcedee887
3 changed files with 4 additions and 3 deletions

View file

@ -2877,6 +2877,7 @@ namespace smt {
void context::push() {
TRACE("trigger_bug", tout << "context::push()\n";);
scoped_suspend_rlimit _suspend_cancel(m_manager.limit());
pop_to_base_lvl();
setup_context(false);
bool was_consistent = !inconsistent();

View file

@ -186,7 +186,7 @@ public:
void push() override {
switch_inc_mode();
m_solver1->push();
m_solver2->push();
m_solver2->push();
}
void pop(unsigned n) override {

View file

@ -90,9 +90,9 @@ void solver_na2as::push() {
void solver_na2as::pop(unsigned n) {
if (n > 0) {
pop_core(n);
unsigned lvl = m_scopes.size();
SASSERT(n <= lvl);
n = std::min(lvl, n);
pop_core(n);
unsigned new_lvl = lvl - n;
restore_assumptions(m_scopes[new_lvl]);
m_scopes.shrink(new_lvl);