Skip to content

Commit b1893f2

Browse files
fix build issue for debug mode
Signed-off-by: Nikolaj Bjorner <[email protected]>
1 parent 1827f98 commit b1893f2

File tree

6 files changed

+40
-8
lines changed

6 files changed

+40
-8
lines changed

src/api/api_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ extern "C" {
171171
mk_c(c)->save_ast_trail(result.get());
172172
*v = of_ast(result.get());
173173
RETURN_Z3_model_eval true;
174-
Z3_CATCH_RETURN(0);
174+
Z3_CATCH_RETURN(false);
175175
}
176176

177177
unsigned Z3_API Z3_model_get_num_sorts(Z3_context c, Z3_model m) {

src/ast/ast.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,29 @@ bool family_manager::has_family(symbol const & s) const {
169169
return m_families.contains(s);
170170
}
171171

172+
#if 0
173+
static unsigned s_count = 0;
174+
void ast::inc_ref() {
175+
SASSERT(m_ref_count < UINT_MAX);
176+
m_ref_count ++;
177+
if (get_id() == 1) {
178+
s_count++;
179+
if (s_count >= 36530) {
180+
TRACE("rc", tout << "inc_ref " << m_ref_count << "\n";);
181+
}
182+
}
183+
}
184+
185+
void ast::dec_ref() {
186+
SASSERT(m_ref_count > 0);
187+
m_ref_count --;
188+
if (get_id() == 1 && s_count >= 36530) {
189+
TRACE("rc", tout << "dec_ref " << m_ref_count << "\n";);
190+
// IF_VERBOSE(0, verbose_stream() << "dec_rc " << s_count << "\n";);
191+
}
192+
}
193+
#endif
194+
172195
// -----------------------------------
173196
//
174197
// decl_info
@@ -1814,7 +1837,6 @@ ast * ast_manager::register_node_core(ast * n) {
18141837

18151838

18161839
n->m_id = is_decl(n) ? m_decl_id_gen.mk() : m_expr_id_gen.mk();
1817-
18181840

18191841
TRACE("ast", tout << "Object " << n->m_id << " was created.\n";);
18201842
TRACE("mk_var_bug", tout << "mk_ast: " << n->m_id << "\n";);

src/ast/ast.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ class ast {
482482
void * m_mark2_owner;
483483
#endif
484484

485+
#if 1
485486
void inc_ref() {
486487
SASSERT(m_ref_count < UINT_MAX);
487488
m_ref_count ++;
@@ -491,6 +492,12 @@ class ast {
491492
SASSERT(m_ref_count > 0);
492493
m_ref_count --;
493494
}
495+
#else
496+
void inc_ref();
497+
498+
void dec_ref();
499+
500+
#endif
494501

495502
ast(ast_kind k):m_id(UINT_MAX), m_kind(k), m_mark1(false), m_mark2(false), m_mark_shared_occs(false), m_ref_count(0) {
496503
DEBUG_CODE({

src/sat/sat_ddfw.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ namespace sat {
569569
for (literal lit : get_clause(i)) {
570570
if (is_true(lit)) found = true;
571571
}
572-
SASSERT(ci.is_true() == found);
573572
SASSERT(found == !m_unsat.contains(i));
574573
}
575574
// every variable in a false clause is in unsat vars

src/smt/smt_case_split_queue.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ namespace smt {
245245
void mk_var_eh(bool_var v) override {
246246
expr * n = m_context.bool_var2expr(v);
247247
double act;
248-
if (m_cache.find(n, act))
248+
if (n && m_cache.find(n, act))
249249
m_context.set_activity(v, act);
250250
act_case_split_queue::mk_var_eh(v);
251251
}
@@ -255,8 +255,10 @@ namespace smt {
255255
double act = m_context.get_activity(v);
256256
if (act > 0.0) {
257257
expr * n = m_context.bool_var2expr(v);
258-
m_cache.insert(n, act);
259-
m_cache_domain.push_back(n);
258+
if (n) {
259+
m_cache.insert(n, act);
260+
m_cache_domain.push_back(n);
261+
}
260262
}
261263
}
262264
act_case_split_queue::del_var_eh(v);

src/util/rlimit.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ uint64_t reslimit::count() const {
4040

4141
bool reslimit::inc() {
4242
++m_count;
43-
return (m_cancel == 0 && (m_limit == 0 || m_count <= m_limit)) || m_suspend;
43+
bool r = (m_cancel == 0 && (m_limit == 0 || m_count <= m_limit)) || m_suspend;
44+
return r;
4445
}
4546

4647
bool reslimit::inc(unsigned offset) {
4748
m_count += offset;
48-
return (m_cancel == 0 && (m_limit == 0 || m_count <= m_limit)) || m_suspend;
49+
bool r = (m_cancel == 0 && (m_limit == 0 || m_count <= m_limit)) || m_suspend;
50+
return r;
4951
}
5052

5153
void reslimit::push(unsigned delta_limit) {

0 commit comments

Comments
 (0)