|
|
|
@ -35,6 +35,9 @@ module type S = sig
|
|
|
|
|
(** get the reportable source-sink flows in this trace *)
|
|
|
|
|
val get_reports : t -> (Source.t * Sink.t * Passthrough.Set.t) list
|
|
|
|
|
|
|
|
|
|
(** log the reportable source-sink flows in this trace *)
|
|
|
|
|
val log_reports : t -> Procname.t -> Location.t -> unit
|
|
|
|
|
|
|
|
|
|
(** create a trace from a source *)
|
|
|
|
|
val of_source : Source.t -> t
|
|
|
|
|
|
|
|
|
@ -99,6 +102,19 @@ module Make (Spec : Spec) = struct
|
|
|
|
|
else acc in
|
|
|
|
|
Sources.fold (fun source acc -> Sinks.fold (report_one source) t.sinks acc) t.sources []
|
|
|
|
|
|
|
|
|
|
let log_reports t pname loc =
|
|
|
|
|
let report_one (source, sink, passthroughs) =
|
|
|
|
|
let pp_error fmt () =
|
|
|
|
|
F.fprintf
|
|
|
|
|
fmt
|
|
|
|
|
"Error: %a -> %a via %a"
|
|
|
|
|
Source.pp source Sink.pp sink Passthrough.Set.pp passthroughs in
|
|
|
|
|
let msg = "QUANDARY_TAINT_ERROR" in
|
|
|
|
|
let description = pp_to_string pp_error () in
|
|
|
|
|
let exn = Exceptions.Checkers (msg, Localise.verbatim_desc description) in
|
|
|
|
|
Reporting.log_error pname exn ~loc in
|
|
|
|
|
IList.iter report_one (get_reports t)
|
|
|
|
|
|
|
|
|
|
let of_source source =
|
|
|
|
|
let sources = Sources.singleton source in
|
|
|
|
|
let passthroughs = Passthrough.Set.empty in
|
|
|
|
|