Skip to content

Commit

Permalink
Fixed bug in UP (#7545)
Browse files Browse the repository at this point in the history
* Fixed bug in UP

* Put decrement at the right position
  • Loading branch information
CEisenhofer authored Feb 4, 2025
1 parent 17d47ca commit 0919844
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/c++/z3++.h
Original file line number Diff line number Diff line change
Expand Up @@ -4305,15 +4305,18 @@ namespace z3 {
context* c;
std::vector<z3::context*> subcontexts;

unsigned m_callbackNesting = 0;
Z3_solver_callback cb { nullptr };

struct scoped_cb {
user_propagator_base& p;
scoped_cb(void* _p, Z3_solver_callback cb):p(*static_cast<user_propagator_base*>(_p)) {
p.cb = cb;
p.m_callbackNesting++;
}
~scoped_cb() {
p.cb = nullptr;
if (--p.m_callbackNesting == 0)
p.cb = nullptr;
}
};

Expand Down

0 comments on commit 0919844

Please sign in to comment.