[starvation] default to recursive if type unknown

Summary: As per title.

Reviewed By: jvillard

Differential Revision: D29066300

fbshipit-source-id: fd269835a
master
Nikos Gorogiannis 4 years ago committed by Facebook GitHub Bot
parent ae3da516e5
commit 7e4f5ec43b

@ -128,9 +128,8 @@ module Lock = struct
let is_recursive tenv lock = let is_recursive tenv lock =
(* The "default" below is returned when we don't have enough information. We choose (* We default to recursive if the type can't be found or looks malformed.
the default depending on the language, since most Java locks are recursive and most C++ locks This reduces self-deadlock FPs. *)
are not. *)
match get_typ tenv lock with match get_typ tenv lock with
| Some {Typ.desc= Tptr ({desc= Tstruct name}, _) | Tstruct name} -> | Some {Typ.desc= Tptr ({desc= Tstruct name}, _) | Tstruct name} ->
ConcurrencyModels.is_recursive_lock_type name ConcurrencyModels.is_recursive_lock_type name
@ -138,11 +137,11 @@ module Lock = struct
(* weird type passed as a lock, return default *) (* weird type passed as a lock, return default *)
L.debug Analysis Verbose "Asked if non-struct type %a is a recursive lock type.@\n" L.debug Analysis Verbose "Asked if non-struct type %a is a recursive lock type.@\n"
(Typ.pp_full Pp.text) typ ; (Typ.pp_full Pp.text) typ ;
Language.curr_language_is Java true
| None -> | None ->
(* could not find type definition, return default *) (* could not find type definition, return default *)
L.debug Analysis Verbose "Could not resolve type for lock %a.@\n" pp lock ; L.debug Analysis Verbose "Could not resolve type for lock %a.@\n" pp lock ;
Language.curr_language_is Java true
end end
module AccessExpressionDomain = struct module AccessExpressionDomain = struct

Loading…
Cancel
Save