Skip to content
Snippets Groups Projects
Commit e687dc19 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[Eva] prevent crash with -audit-prepare before -then

parent 54e6af01
No related branches found
No related tags found
No related merge requests found
......@@ -1766,7 +1766,14 @@ let prepare_from_c_files () =
let audit_path = Kernel.AuditPrepare.get () in
if not (Filepath.Normalized.is_empty audit_path) then begin
let all_sources_tbl = compute_sources_table cpp_commands in
print_all_sources audit_path all_sources_tbl;
begin
try
print_all_sources audit_path all_sources_tbl
with Json.CannotMerge _ ->
Kernel.abort "%s already computed; it should be set by itself, \
after the last '-then' in the command line."
Kernel.AuditPrepare.option_name
end;
if not (Filepath.Normalized.is_special_stdout audit_path) then
Kernel.feedback "Audit: sources list written to: %a@."
Filepath.Normalized.pretty audit_path;
......
......@@ -176,7 +176,14 @@ let force_compute () =
if not (Kernel.AuditCheck.is_empty ()) then
Eva_audit.check_configuration (Kernel.AuditCheck.get ());
if not (Kernel.AuditPrepare.is_empty ()) then
Eva_audit.print_configuration (Kernel.AuditPrepare.get ());
begin
try
Eva_audit.print_configuration (Kernel.AuditPrepare.get ());
with Json.CannotMerge _ ->
Kernel.abort "%s already computed; it should be set by itself, \
after the last '-then' in the command line."
Kernel.AuditPrepare.option_name
end;
let kf, lib_entry = Globals.entry_point () in
reset_analyzer ();
let module Analyzer = (val snd !ref_analyzer) in
......
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