Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMT2 back-end: report error when invoking solver fails #8378

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/solvers/smt2/smt2_dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#include "smt2irep.h"

#include <filesystem>

Check warning on line 18 in src/solvers/smt2/smt2_dec.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_dec.cpp#L18

Added line #L18 was not covered by tests

std::string smt2_dect::decision_procedure_text() const
{
// clang-format off
Expand Down Expand Up @@ -135,13 +137,14 @@
UNREACHABLE;
}

int res =
run(argv[0], argv, stdin_filename, temp_file_stdout(), temp_file_stderr());
run(argv[0], argv, stdin_filename, temp_file_stdout(), temp_file_stderr());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should run not rather return a proper result?


if(res<0)
if(!std::filesystem::is_empty(temp_file_stderr()))
{
messaget log{message_handler};
log.error() << "error running SMT2 solver" << messaget::eom;
std::ifstream stderr_stream(temp_file_stderr());
log.error() << "error running SMT2 solver: " << stderr_stream.rdbuf()
<< messaget::eom;

Check warning on line 147 in src/solvers/smt2/smt2_dec.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_dec.cpp#L145-L147

Added lines #L145 - L147 were not covered by tests
return decision_proceduret::resultt::D_ERROR;
}

Expand Down
Loading