Commit 70bfa5dc authored by Virgile Prevosto's avatar Virgile Prevosto Committed by Andre Maroneze
Browse files

[MdR] avoid duplicate invocations in SARIF

parent f35e8676
......@@ -60,7 +60,19 @@ module Analysis_cmdline =
let command_line () = Array.to_list Sys.argv
let update_cmdline () = Analysis_cmdline.add (command_line())
let update_cmdline =
let already_updated = ref false in
fun () ->
if not (!already_updated) then begin
(* This function must be run after the loading stage, so that
the Analysis_cmdline state contains the list of previous launches
if any. However, `-then` restart the boot sequence from the loading
included, meaning that the hook will be replayed _also_ after each
`-then`. Using a _non-projectified_ boolean ref ensures that we add
the command line only once per run. *)
already_updated := true;
Analysis_cmdline.add (command_line())
end
let () = Cmdline.run_after_loading_stage update_cmdline
......
......@@ -34,17 +34,6 @@
"exitCode": 0,
"executionSuccessful": true
},
{
"commandLine":
"frama-c -check -load tests/sarif/result/cwe125_eva.sav -then -mdr-out tests/sarif/result/cwe125.sarif -mdr-gen sarif -mdr-no-print-libc -mdr-sarif-deterministic",
"arguments": [
"-check", "-load", "tests/sarif/result/cwe125_eva.sav", "-then",
"-mdr-out", "tests/sarif/result/cwe125.sarif", "-mdr-gen",
"sarif", "-mdr-no-print-libc", "-mdr-sarif-deterministic"
],
"exitCode": 0,
"executionSuccessful": true
},
{
"commandLine":
"frama-c -check -load tests/sarif/result/cwe125_eva.sav -then -mdr-out tests/sarif/result/cwe125.sarif -mdr-gen sarif -mdr-no-print-libc -mdr-sarif-deterministic",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment