Skip to content

Commit

Permalink
Fix YAML witness validate/unassume error with empty (unparsable) path
Browse files Browse the repository at this point in the history
Raised an obscure Invalid_argument exception instead.
  • Loading branch information
sim642 committed Nov 6, 2024
1 parent 546a8d0 commit 2048122
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/analyses/unassumeAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct
| _ -> ()
);

let yaml = match Yaml_unix.of_file (Fpath.v (GobConfig.get_string "witness.yaml.unassume")) with
let yaml = match GobResult.Syntax.(Fpath.of_string (GobConfig.get_string "witness.yaml.unassume") >>= Yaml_unix.of_file) with
| Ok yaml -> yaml
| Error (`Msg m) ->
Logs.error "Yaml_unix.of_file: %s" m;
Expand Down
2 changes: 1 addition & 1 deletion src/witness/yamlWitness.ml
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ struct

let inv_parser = InvariantParser.create FileCfg.file in

let yaml = match Yaml_unix.of_file (Fpath.v (GobConfig.get_string "witness.yaml.validate")) with
let yaml = match GobResult.Syntax.(Fpath.of_string (GobConfig.get_string "witness.yaml.validate") >>= Yaml_unix.of_file) with
| Ok yaml -> yaml
| Error (`Msg m) ->
Logs.error "Yaml_unix.of_file: %s" m;
Expand Down

0 comments on commit 2048122

Please sign in to comment.