Skip to content

Commit

Permalink
Merge pull request #3067 from Johanmyst/z3_version_check_fix
Browse files Browse the repository at this point in the history
Fixed Z3 version check crash
  • Loading branch information
mtzguido authored Oct 17, 2023
2 parents e2a4de3 + 6746733 commit f7c80bf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
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

0 comments on commit f7c80bf

Please sign in to comment.