[quandary] log internal error when taint sink index doesn't match

Summary: A temporary workaround until we can understand why this happens and fix it.

Reviewed By: jeremydubreil

Differential Revision: D5559838

fbshipit-source-id: dc86eb9
master
Sam Blackshear 7 years ago committed by Facebook Github Bot
parent 4b8a5683aa
commit 91d518979b

@ -238,8 +238,8 @@ module Make (TaintSpecification : TaintSpec.S) = struct
let add_sink sink actuals access_tree proc_data callee_site = let add_sink sink actuals access_tree proc_data callee_site =
(* add [sink] to the trace associated with the [formal_index]th actual *) (* add [sink] to the trace associated with the [formal_index]th actual *)
let add_sink_to_actual sink_index access_tree_acc = let add_sink_to_actual sink_index access_tree_acc =
match List.nth_exn actuals sink_index with match List.nth actuals sink_index with
| HilExp.AccessPath actual_ap_raw | Some HilExp.AccessPath actual_ap_raw
-> ( -> (
let actual_ap = AccessPath.Abs.Abstracted actual_ap_raw in let actual_ap = AccessPath.Abs.Abstracted actual_ap_raw in
match access_path_get_node actual_ap access_tree_acc proc_data with match access_path_get_node actual_ap access_tree_acc proc_data with
@ -253,6 +253,11 @@ module Make (TaintSpecification : TaintSpec.S) = struct
TaintDomain.add_trace actual_ap actual_trace' access_tree_acc TaintDomain.add_trace actual_ap actual_trace' access_tree_acc
| None | None
-> access_tree_acc ) -> access_tree_acc )
| None
-> Logging.internal_error
"Taint is supposed to flow into sink %a at index %d, but the index is out of bounds@\n"
CallSite.pp callee_site sink_index ;
access_tree_acc
| _ | _
-> access_tree_acc -> access_tree_acc
in in

Loading…
Cancel
Save