From 5b041d46ad8ec39201bf48bfcb6413ea8c5490ba Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Thu, 19 May 2016 06:49:35 -0700 Subject: [PATCH] remember when a method is synchronized Reviewed By: jvillard Differential Revision: D3322203 fbshipit-source-id: 01622d1 --- infer/src/IR/ProcAttributes.re | 2 ++ infer/src/IR/ProcAttributes.rei | 1 + infer/src/java/jTrans.ml | 1 + 3 files changed, 4 insertions(+) diff --git a/infer/src/IR/ProcAttributes.re b/infer/src/IR/ProcAttributes.re index cb4a3abe7..c31ae23eb 100644 --- a/infer/src/IR/ProcAttributes.re +++ b/infer/src/IR/ProcAttributes.re @@ -32,6 +32,7 @@ type t = { is_defined: bool, /** true if the procedure is defined, and not just declared */ is_objc_instance_method: bool, /** the procedure is an objective-C instance method */ is_cpp_instance_method: bool, /** the procedure is an C++ instance method */ + is_java_synchronized_method: bool, /** the procedure is a Java synchronized method */ mutable is_synthetic_method: bool, /** the procedure is a synthetic method */ language: Config.language, /** language of the procedure */ loc: Location.t, /** location of this procedure in the source code */ @@ -54,6 +55,7 @@ let default proc_name language => { is_abstract: false, is_bridge_method: false, is_cpp_instance_method: false, + is_java_synchronized_method: false, is_defined: false, is_objc_instance_method: false, is_synthetic_method: false, diff --git a/infer/src/IR/ProcAttributes.rei b/infer/src/IR/ProcAttributes.rei index f39b71aa0..6df4d92b0 100644 --- a/infer/src/IR/ProcAttributes.rei +++ b/infer/src/IR/ProcAttributes.rei @@ -26,6 +26,7 @@ type t = { is_defined: bool, /** true if the procedure is defined, and not just declared */ is_objc_instance_method: bool, /** the procedure is an objective-C instance method */ is_cpp_instance_method: bool, /** the procedure is an C++ instance method */ + is_java_synchronized_method: bool, /** the procedure is a Java synchronized method */ mutable is_synthetic_method: bool, /** the procedure is a synthetic method */ language: Config.language, /** language of the procedure */ loc: Location.t, /** location of this procedure in the source code */ diff --git a/infer/src/java/jTrans.ml b/infer/src/java/jTrans.ml index 6e923a06f..b27bf8ed4 100644 --- a/infer/src/java/jTrans.ml +++ b/infer/src/java/jTrans.ml @@ -337,6 +337,7 @@ let create_local_procdesc program linereader cfg tenv node m = is_bridge_method = cm.Javalib.cm_bridge; is_defined = true; is_synthetic_method = cm.Javalib.cm_synthetic; + is_java_synchronized_method = cm.Javalib.cm_synchronized; loc = loc_start; locals; method_annotation;