mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 17:44:08 +00:00
Fixed bug in UP (#7545)
* Fixed bug in UP * Put decrement at the right position
This commit is contained in:
parent
17d47ca8c7
commit
091984419e
|
@ -4305,15 +4305,18 @@ namespace z3 {
|
||||||
context* c;
|
context* c;
|
||||||
std::vector<z3::context*> subcontexts;
|
std::vector<z3::context*> subcontexts;
|
||||||
|
|
||||||
|
unsigned m_callbackNesting = 0;
|
||||||
Z3_solver_callback cb { nullptr };
|
Z3_solver_callback cb { nullptr };
|
||||||
|
|
||||||
struct scoped_cb {
|
struct scoped_cb {
|
||||||
user_propagator_base& p;
|
user_propagator_base& p;
|
||||||
scoped_cb(void* _p, Z3_solver_callback cb):p(*static_cast<user_propagator_base*>(_p)) {
|
scoped_cb(void* _p, Z3_solver_callback cb):p(*static_cast<user_propagator_base*>(_p)) {
|
||||||
p.cb = cb;
|
p.cb = cb;
|
||||||
|
p.m_callbackNesting++;
|
||||||
}
|
}
|
||||||
~scoped_cb() {
|
~scoped_cb() {
|
||||||
p.cb = nullptr;
|
if (--p.m_callbackNesting == 0)
|
||||||
|
p.cb = nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue