mirror of
https://github.com/Z3Prover/z3
synced 2025-05-03 22:05:45 +00:00
fix #3169 - set cancellation timeout and limit during push. Also expose internalization outside of scope that disables cancellation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7d976e4f4d
commit
f501380e89
6 changed files with 25 additions and 10 deletions
|
@ -1382,11 +1382,24 @@ void cmd_context::push() {
|
|||
s.m_macros_stack_lim = m_macros_stack.size();
|
||||
s.m_aux_pdecls_lim = m_aux_pdecls.size();
|
||||
s.m_assertions_lim = m_assertions.size();
|
||||
unsigned timeout = m_params.m_timeout;
|
||||
m().limit().push(m_params.rlimit());
|
||||
if (m_solver)
|
||||
m_solver->push();
|
||||
if (m_opt)
|
||||
m_opt->push();
|
||||
cancel_eh<reslimit> eh(m().limit());
|
||||
scoped_ctrl_c ctrlc(eh);
|
||||
scoped_timer timer(timeout, &eh);
|
||||
scoped_rlimit _rlimit(m().limit(), m_params.rlimit());
|
||||
try {
|
||||
if (m_solver)
|
||||
m_solver->push();
|
||||
if (m_opt)
|
||||
m_opt->push();
|
||||
}
|
||||
catch (z3_error & ex) {
|
||||
throw ex;
|
||||
}
|
||||
catch (z3_exception & ex) {
|
||||
throw cmd_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
void cmd_context::push(unsigned n) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue