Skip to content

Commit

Permalink
Check YAML witness existence before analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Jun 25, 2024
1 parent 9fd0fd5 commit 85ab1fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/framework/control.ml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ struct
(* real beginning of the [analyze] function *)
if get_bool "ana.sv-comp.enabled" then
Witness.init (module FileCfg); (* TODO: move this out of analyze_loop *)
YamlWitness.init ();

AnalysisState.global_initialization := true;
GobConfig.earlyglobs := get_bool "exp.earlyglobs";
Expand Down
9 changes: 9 additions & 0 deletions src/witness/yamlWitness.ml
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,15 @@ struct
Timing.wrap "yaml witness" write ()
end

let init () =
match GobConfig.get_string "witness.yaml.validate" with
| "" -> ()
| path ->
(* Check witness existence before doing the analysis. *)
if not (Sys.file_exists path) then (
Logs.error "witness.yaml.validate: %s not found" path;
Svcomp.errorwith "witness missing"
)

module ValidationResult =
struct
Expand Down

0 comments on commit 85ab1fd

Please sign in to comment.