Skip to content
Snippets Groups Projects
Commit 7fb2e807 authored by David Bühler's avatar David Bühler
Browse files

Merge branch 'fix/andre/eva-audit-json-error' into 'master'

[Eva] avoid crash in -eva-audit due to malformed JSON file

See merge request frama-c/frama-c!3187
parents 87f3dca1 04608219
No related branches found
No related tags found
No related merge requests found
......@@ -178,6 +178,7 @@ val merge_array : Filepath.Normalized.t -> Yojson.Basic.t -> unit
(**
[from_file path] opens [path] and stores its JSON object in
a memory cache, to be used by the other related functions.
@raise Yojson.Json_error if [path] is a malformed JSON file.
@since Frama-C+dev
*)
val from_file: Filepath.Normalized.t -> Yojson.Basic.t
......
......@@ -135,10 +135,14 @@ let check_warning_status json name (module Plugin: Log.Messages) =
(Pretty_utils.pp_list ~sep:", " Format.pp_print_string) should_be_enabled
let check_configuration path =
let json = Json.from_file path in
check_correctness_parameters json;
check_warning_status json "Kernel" (module Kernel);
check_warning_status json "Eva" (module Value_parameters)
try
let json = Json.from_file path in
check_correctness_parameters json;
check_warning_status json "Kernel" (module Kernel);
check_warning_status json "Eva" (module Value_parameters)
with Yojson.Json_error msg ->
Kernel.abort "error reading JSON file %a: %s"
Filepath.Normalized.pretty path msg
let print_configuration path =
print_correctness_parameters path;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment