From ce7317e5cda304813ac0adea5b91382378309644 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Fri, 19 Jun 2020 08:49:09 -0700 Subject: [PATCH] [CCBM] Support more config format (GK) Reviewed By: ezgicicek Differential Revision: D22044309 fbshipit-source-id: 7dbcd4f1f --- infer/src/checkers/ConfigChecksBetweenMarkers.ml | 14 ++++++++------ infer/src/opensource/FbGKInteraction.ml | 2 +- infer/src/opensource/FbGKInteraction.mli | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/infer/src/checkers/ConfigChecksBetweenMarkers.ml b/infer/src/checkers/ConfigChecksBetweenMarkers.ml index c3114d7c0..7319371f1 100644 --- a/infer/src/checkers/ConfigChecksBetweenMarkers.ml +++ b/infer/src/checkers/ConfigChecksBetweenMarkers.ml @@ -405,12 +405,14 @@ module TransferFunctions = struct | Call (_, Const (Cfun callee), _ :: (Const (Cint marker), _) :: _, _, _) when FbGKInteraction.is_marker_end tenv callee -> Dom.call_marker_end marker astate - | Call (_, Const (Cfun callee), _ :: (Var id, _) :: _, location, _) - when FbGKInteraction.is_config_check tenv callee -> - Dom.call_config_check analysis_data id location astate - | Call (_, Const (Cfun callee), _, location, _) -> - Option.value_map (analyze_dependency callee) ~default:astate ~f:(fun (_, callee_summary) -> - Dom.instantiate_callee analysis_data ~callee ~callee_summary location astate ) + | Call (_, Const (Cfun callee), args, location, _) -> ( + match FbGKInteraction.get_config_check tenv callee args with + | Some id -> + Dom.call_config_check analysis_data id location astate + | None -> + Option.value_map (analyze_dependency callee) ~default:astate + ~f:(fun (_, callee_summary) -> + Dom.instantiate_callee analysis_data ~callee ~callee_summary location astate ) ) | _ -> astate diff --git a/infer/src/opensource/FbGKInteraction.ml b/infer/src/opensource/FbGKInteraction.ml index ba63de548..7e9076670 100644 --- a/infer/src/opensource/FbGKInteraction.ml +++ b/infer/src/opensource/FbGKInteraction.ml @@ -19,7 +19,7 @@ end let get_config _ = None -let is_config_check _ _ = false +let get_config_check _ _ _ = None let is_marker_start _ _ = false diff --git a/infer/src/opensource/FbGKInteraction.mli b/infer/src/opensource/FbGKInteraction.mli index b88727841..3dab3d09c 100644 --- a/infer/src/opensource/FbGKInteraction.mli +++ b/infer/src/opensource/FbGKInteraction.mli @@ -17,7 +17,7 @@ end val get_config : 'exp -> 'config_name option -val is_config_check : 'tenv -> 'pname -> bool +val get_config_check : 'tenv -> 'pname -> 'args -> 'ident option val is_marker_start : 'tenv -> 'pname -> bool