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

Fixed Z3 version check crash #3067

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
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
28 changes: 18 additions & 10 deletions ocaml/fstar-lib/generated/FStar_SMTEncoding_Z3.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/smtencoding/FStar.SMTEncoding.Z3.fst
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,15 @@ let check_z3version (p:proc) : unit =
);
_already_warned_solver_mismatch := true
);
let ver = getinfo "version" in
if ver <> Options.z3_version () && not (!_already_warned_version_mismatch) then (
let ver_found : string = BU.trim_string (List.hd (BU.split (getinfo "version") "-")) in
let ver_conf : string = BU.trim_string (Options.z3_version ()) in
if ver_conf <> ver_found && not (!_already_warned_version_mismatch) then (
Errors.log_issue Range.dummyRange (Errors.Warning_SolverMismatch,
BU.format5 "Unexpected Z3 version for `%s': expected %s, got %s.\n\
BU.format5 "Unexpected Z3 version for `%s': expected `%s', got `%s'.\n\
Please download the correct version of Z3 from %s\n\
and install it into your $PATH as `%s'."
(proc_prog p)
(Options.z3_version()) ver
ver_conf ver_found
z3url (Platform.exe ("z3-" ^ Options.z3_version ()))
);
_already_warned_version_mismatch := true
Expand Down