From 926c6fee97879a3c52aefdc3fa2588e5be4ca37e Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Fri, 30 Jun 2017 17:58:59 -0700 Subject: [PATCH] [threadsafety] Skip indirect calls in C++ Summary: They are expected to occur in C++ code, so don't fail on them. For now just skip them, although a better treatment of dynamic dispatch may be needed later. Reviewed By: da319, mbouaziz Differential Revision: D5292462 fbshipit-source-id: 4285514 --- infer/src/checkers/ThreadSafety.ml | 6 +++++- infer/src/checkers/ThreadSafetyDomain.ml | 2 -- infer/src/checkers/ThreadSafetyDomain.mli | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/infer/src/checkers/ThreadSafety.ml b/infer/src/checkers/ThreadSafety.ml index f1a9aa8c7..9f3dfcffa 100644 --- a/infer/src/checkers/ThreadSafety.ml +++ b/infer/src/checkers/ThreadSafety.ml @@ -810,7 +810,11 @@ module TransferFunctions (CFG : ProcCfg.S) = struct astate in { astate' with accesses; } | Call (_, Indirect _, _, _, _) -> - failwithf "Unexpected indirect call instruction %a" HilInstr.pp instr + match Procdesc.get_proc_name pdesc with + | Typ.Procname.Java _ -> + failwithf "Unexpected indirect call instruction %a" HilInstr.pp instr + | _ -> + astate end module Analyzer = AbstractInterpreter.Make (ProcCfg.Normal) (LowerHil.Make(TransferFunctions)) diff --git a/infer/src/checkers/ThreadSafetyDomain.ml b/infer/src/checkers/ThreadSafetyDomain.ml index 6bbd25804..7084be747 100644 --- a/infer/src/checkers/ThreadSafetyDomain.ml +++ b/infer/src/checkers/ThreadSafetyDomain.ml @@ -11,8 +11,6 @@ open! IStd module F = Format -module AccessPathSetDomain = AbstractDomain.InvertedSet(AccessPath.RawSet) - module Access = struct type kind = | Read diff --git a/infer/src/checkers/ThreadSafetyDomain.mli b/infer/src/checkers/ThreadSafetyDomain.mli index d8922098e..f7894329a 100644 --- a/infer/src/checkers/ThreadSafetyDomain.mli +++ b/infer/src/checkers/ThreadSafetyDomain.mli @@ -11,8 +11,6 @@ open! IStd module F = Format -module AccessPathSetDomain : module type of AbstractDomain.InvertedSet (AccessPath.RawSet) - module Access : sig type kind = | Read