From b3b4e4206787185ca6f5d24dda3aff08cc9c0b6b Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 12 Sep 2017 06:53:55 -0700 Subject: [PATCH] [threadsafety] watch out for non-Java pnames Summary: That match branch is Java-only but could be reached with a C++ method, causing a crash. Reviewed By: jberdine, mbouaziz Differential Revision: D5814041 fbshipit-source-id: 6b1b501 --- infer/src/checkers/ThreadSafety.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/infer/src/checkers/ThreadSafety.ml b/infer/src/checkers/ThreadSafety.ml index efb0890c8..eecd42078 100644 --- a/infer/src/checkers/ThreadSafety.ml +++ b/infer/src/checkers/ThreadSafety.ml @@ -485,6 +485,7 @@ module TransferFunctions (CFG : ProcCfg.S) = struct in match List.rev accesses with | (AccessPath.FieldAccess base_field) :: (AccessPath.FieldAccess container_field) :: _ + when Typ.Procname.is_java callee_pname -> let base_typename = Typ.Name.Java.from_string (Typ.Fieldname.java_get_class base_field) in