mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 17:45:32 +00:00
hardening pop abuse and exception safety for #1776
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
13390e2c3a
commit
fdcedee887
3 changed files with 4 additions and 3 deletions
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue