|
|
|
@ -211,6 +211,23 @@ module DisjunctiveTransferFunctions =
|
|
|
|
|
|
|
|
|
|
module DisjunctiveAnalyzer = AbstractInterpreter.MakeWTO (DisjunctiveTransferFunctions)
|
|
|
|
|
|
|
|
|
|
(* Output cases that sledge was unhappy with in files for later replay or inclusion as sledge test
|
|
|
|
|
cases. We create one file for each PID to avoid all analysis processes racing on writing to the same
|
|
|
|
|
file. *)
|
|
|
|
|
let sledge_test_fmt =
|
|
|
|
|
lazy
|
|
|
|
|
(let sledge_test_output =
|
|
|
|
|
Out_channel.create
|
|
|
|
|
( ResultsDir.get_path Debug
|
|
|
|
|
^/ Printf.sprintf "sledge_test-%d.ml" (Pid.to_int (Unix.getpid ())) )
|
|
|
|
|
in
|
|
|
|
|
let f = F.formatter_of_out_channel sledge_test_output in
|
|
|
|
|
Epilogues.register ~description:"closing sledge debug fd" ~f:(fun () ->
|
|
|
|
|
F.pp_print_flush f () ;
|
|
|
|
|
Out_channel.close sledge_test_output ) ;
|
|
|
|
|
f )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let checker {Callbacks.exe_env; summary} =
|
|
|
|
|
let tenv = Exe_env.get_tenv exe_env (Summary.get_proc_name summary) in
|
|
|
|
|
AbstractValue.init () ;
|
|
|
|
@ -229,3 +246,28 @@ let checker {Callbacks.exe_env; summary} =
|
|
|
|
|
summary
|
|
|
|
|
| None ->
|
|
|
|
|
summary
|
|
|
|
|
| exception exn ->
|
|
|
|
|
(* output sledge replay tests, see comment on [sledge_test_fmt] *)
|
|
|
|
|
IExn.reraise_if exn ~f:(fun () ->
|
|
|
|
|
match Exn.sexp_of_t exn with
|
|
|
|
|
| List [exn; replay] ->
|
|
|
|
|
let exn = Error.t_of_sexp exn in
|
|
|
|
|
L.internal_error "Analysis of %a FAILED:@\n@[%a@]@\n" Procname.pp
|
|
|
|
|
(Procdesc.get_proc_name pdesc) Error.pp exn ;
|
|
|
|
|
F.fprintf (Lazy.force sledge_test_fmt)
|
|
|
|
|
"@\n\
|
|
|
|
|
\ let%%expect_test _ =@\n\
|
|
|
|
|
\ Equality.replay@\n\
|
|
|
|
|
\ {|%a|} ;@\n\
|
|
|
|
|
\ [%%expect {| |}]@\n\
|
|
|
|
|
@\n\
|
|
|
|
|
%!"
|
|
|
|
|
Sexp.pp_hum replay ;
|
|
|
|
|
false
|
|
|
|
|
| _ | (exception _) ->
|
|
|
|
|
(* re-raise original exception *)
|
|
|
|
|
true ) ;
|
|
|
|
|
summary
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let () = Sledge.Timer.enabled := Config.sledge_timers
|
|
|
|
|