fix refinement for the alive tool (regressed in prev commit)
MODIFY
ir/state.cpp
ir/state.cpp
@@ -150,7 +150,7 @@ void State::resetGlobals() {
const State::ValTy& State::exec(const Value &v) {
assert(undef_vars.empty());
- domain.noreturn = false;
+ domain.noreturn = true;
auto val = v.toSMT(*this);
ENSURE(values_map.try_emplace(&v, (unsigned)values.size()).second);
values.emplace_back(&v, ValTy{std::move(val), domain.noreturn, domain.UB(),
@@ -663,7 +663,7 @@ void State::addUB(AndExpr &&ubs) {
void State::addNoReturn(const expr &cond) {
if (cond.isFalse())
return;
- domain.noreturn = cond;
+ domain.noreturn = !cond;
return_memory.add(memory, domain.path && cond);
function_domain.add(domain() && cond);
return_undef_vars.insert(undef_vars.begin(), undef_vars.end());

MODIFY
tools/transform.cpp
tools/transform.cpp
@@ -210,7 +210,7 @@ static bool error(Errors &errs, const State &src_state, const State &tgt_state,
}
if (auto call = dynamic_cast<const FnCall*>(var)) {
- if (m.eval(val.return_domain).isTrue()) {
+ if (m.eval(val.return_domain).isFalse()) {
s << *var << " = function did not return!\n";
break;
} else if (var->isVoid()) {
@@ -515,6 +515,8 @@ check_refinement(Errors &errs, const Transform &t, const State &src_state,
auto [poison_cnstr, value_cnstr] = type.refines(src_state, tgt_state, a, b);
expr dom = retdom_a && retdom_b;
+ if (check_each_var)
+ dom &= fndom_a && fndom_b;
CHECK(dom && !poison_cnstr,
print_value, "Target is more poisonous than source");

MODIFY
util/symexec.cpp
util/symexec.cpp
@@ -59,7 +59,7 @@ void sym_exec(State &s) {
if (name[0] == '%')
dbg() << " = " << val.val << " /";
dbg() << " UB=" << val.domain << '\n';
- if (!val.return_domain.isFalse())
+ if (!val.return_domain.isTrue())
dbg() << " RET=" << val.return_domain << '\n';
}
}

fix refinement for the alive tool (regressed in prev commit)