From bb0a42d25dd497c4fad46440ec3d9125c29fe44e Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Mon, 30 Oct 2017 04:07:18 -0700 Subject: [PATCH] [thread-safety][c++] Skip destructors Summary: The concurrency analyzer often does not understand object lifetimes well enough to realize that destructors are usually not called in parallel with any other methods. This leads to false alarms. This diff suppresses these by simply skipping destructors in the concurrency analysis. Reviewed By: sblackshear Differential Revision: D6182646 fbshipit-source-id: e9d1cac --- infer/src/concurrency/RacerD.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/infer/src/concurrency/RacerD.ml b/infer/src/concurrency/RacerD.ml index d3486d37b..ce99224d4 100644 --- a/infer/src/concurrency/RacerD.ml +++ b/infer/src/concurrency/RacerD.ml @@ -558,8 +558,9 @@ module TransferFunctions (CFG : ProcCfg.S) = struct ["folly::AtomicStruct::load"; "folly::detail::SingletonHolder::createInstance"]) in fun pname -> - QualifiedCppName.Match.match_qualifiers (Lazy.force matcher) - (Typ.Procname.get_qualifiers pname) + Typ.Procname.is_destructor pname + || QualifiedCppName.Match.match_qualifiers (Lazy.force matcher) + (Typ.Procname.get_qualifiers pname) let get_summary caller_pdesc callee_pname actuals callee_loc tenv =