From 9366c94bbc47921559781bb8dd53ba2da00a2d50 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 11 Dec 2019 04:41:00 -0800 Subject: [PATCH] [pulse] avoid false positives involving `folly::fbstring` Summary: That class does some complicated accounting of memory that depends on whether the string is "small", "medium" or "large". In the latter case it does its own ref-counting and copy-on-write to save memory, and that trips up pulse. Pretending all strings are small avoids that issue. Reviewed By: skcho Differential Revision: D18909030 fbshipit-source-id: 1c14d909b --- infer/src/pulse/PulseModels.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/infer/src/pulse/PulseModels.ml b/infer/src/pulse/PulseModels.ml index a4a502227..ee194dd88 100644 --- a/infer/src/pulse/PulseModels.ml +++ b/infer/src/pulse/PulseModels.ml @@ -348,6 +348,9 @@ module ProcNameDispatcher = struct ; +match_builtin BuiltinDecl.__cast <>$ capt_arg_payload $+...$--> Misc.id_first_arg ; +match_builtin BuiltinDecl.abort <>--> Misc.early_exit ; +match_builtin BuiltinDecl.exit <>--> Misc.early_exit + ; (* consider that all fbstrings are small strings to avoid false positives due to manual + ref-counting *) + -"folly" &:: "fbstring_core" &:: "category" &--> Misc.return_int Int64.zero ; -"folly" &:: "DelayedDestruction" &:: "destroy" &--> Misc.skip ; -"folly" &:: "Optional" &:: "reset" &--> Misc.skip ; -"folly" &:: "SocketAddress" &:: "~SocketAddress" &--> Misc.skip