Skip to content

Commit 7f7806b

Browse files
committed
Correctly handle SMT solver errors
`check_sat` in scratch_programt was treating UNSAT and ERROR as the same. This was causing SMT solver errors to be silently ignored, and be treated as UNSAT results instead.
1 parent cce4503 commit 7f7806b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/goto-instrument/accelerate/scratch_program.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ bool scratch_programt::check_sat(bool do_slice, guard_managert &guard_manager)
7171
std::cout << "Finished symex, invoking decision procedure.\n";
7272
#endif
7373

74-
return ((*checker)() == decision_proceduret::resultt::D_SATISFIABLE);
74+
auto result = (*checker)();
75+
if(result == decision_proceduret::resultt::D_ERROR)
76+
throw "error running the SMT solver";
77+
return (result == decision_proceduret::resultt::D_SATISFIABLE);
7578
}
7679

7780
exprt scratch_programt::eval(const exprt &e)

0 commit comments

Comments
 (0)