Skip to content

Commit

Permalink
fix un-intialized variable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Sep 30, 2024
1 parent 2c94a3a commit 551cc53
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/math/lp/nla_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ bool core::is_nl_var(lpvar j) const {


unsigned core::get_var_weight(lpvar j) const {
unsigned k;
unsigned k = 0;
switch (lra.get_column_type(j)) {

case lp::column_type::fixed:
Expand Down
2 changes: 1 addition & 1 deletion src/muz/base/dl_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ namespace datalog {
void context::register_finite_sort(sort * s, sort_kind k) {
m_pinned.push_back(s);
SASSERT(!m_sorts.contains(s));
sort_domain * dom;
sort_domain * dom = nullptr;
switch (k) {
case SK_SYMBOL:
dom = alloc(symbol_sort_domain, *this, s);
Expand Down
2 changes: 1 addition & 1 deletion src/muz/spacer/spacer_antiunify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void anti_unifier::operator()(expr *e1, expr *e2, expr_ref &res,
m_todo.pop_back();
}

expr *r;
expr *r = nullptr;
VERIFY(m_cache.find(e1, e2, r));
res = r;

Expand Down
6 changes: 3 additions & 3 deletions src/muz/spacer/spacer_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class pred_transformer {
}
pt_rule &mk_rule(const pt_rule &v);
void set_tag(expr *tag, pt_rule &v) {
pt_rule *p;
pt_rule *p = nullptr;
VERIFY(find_by_rule(v.rule(), p));
p->set_tag(tag);
m_tags.insert(tag, p);
Expand Down Expand Up @@ -569,7 +569,7 @@ class pred_transformer {
expr *transition() const { return m_transition; }
expr *init() const { return m_init; }
expr *rule2tag(datalog::rule const *r) {
pt_rule *p;
pt_rule *p = nullptr;
return m_pt_rules.find_by_rule(*r, p) ? p->tag() : nullptr;
}
unsigned get_num_levels() const { return m_frames.size(); }
Expand Down Expand Up @@ -600,7 +600,7 @@ class pred_transformer {
bool_vector &reach_pred_used,
unsigned &num_reuse_reach);
expr *get_transition(datalog::rule const &r) {
pt_rule *p;
pt_rule *p = nullptr;
return m_pt_rules.find_by_rule(r, p) ? p->trans() : nullptr;
}
ptr_vector<app> &get_aux_vars(datalog::rule const &r) {
Expand Down
2 changes: 1 addition & 1 deletion src/muz/spacer/spacer_legacy_mev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ void model_evaluator::eval_eq(app* e, expr* arg1, expr* arg2)
void model_evaluator::eval_basic(app* e)
{
expr* arg1, *arg2;
expr *argCond, *argThen, *argElse, *arg;
expr *argCond = nullptr, *argThen = nullptr, *argElse = nullptr, *arg = nullptr;
bool has_x = false;
unsigned arity = e->get_num_args();
switch (e->get_decl_kind()) {
Expand Down
2 changes: 1 addition & 1 deletion src/sat/smt/arith_axioms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ namespace arith {

bool solver::check_bv_term(app* n) {
unsigned sz;
expr* _x, * _y;
expr* _x = nullptr, * _y = nullptr;
if (!ctx.is_relevant(expr2enode(n)))
return true;
expr_ref vx(m), vy(m),vn(m);
Expand Down
2 changes: 1 addition & 1 deletion src/smt/theory_arith_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ namespace smt {
for (unsigned i = 1; i < unsat_row.size(); ++i) {
numeral c(unsat_row[i]);
if (!c.is_zero()) {
theory_var var;
theory_var var = null_theory_var;
if (!index2var.find(i, var)) {
UNREACHABLE();
}
Expand Down
2 changes: 1 addition & 1 deletion src/smt/theory_lra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ class theory_lra::imp {
}

final_check_status eval_power(expr* e) {
expr* x, * y;
expr* x = nullptr, * y = nullptr;
rational r;
VERIFY(a.is_power(e, x, y));
if (a.is_numeral(x, r) && r == 0 && a.is_numeral(y, r) && r == 0)
Expand Down

0 comments on commit 551cc53

Please sign in to comment.