[thread-safety] treat generated GraphQL constructors as returning ownership

Reviewed By: jeremydubreil

Differential Revision: D4552975

fbshipit-source-id: 199b01b
master
Sam Blackshear 8 years ago committed by Facebook Github Bot
parent b8f9c774f3
commit 4f33ecef1e

@ -421,6 +421,18 @@ module TransferFunctions (CFG : ProcCfg.S) = struct
end end
| _ -> | _ ->
astate astate
else if FbThreadSafety.is_graphql_constructor callee_pname
then
(* assume generated GraphQL code returns ownership *)
match ret_opt with
| Some (ret_id, ret_typ) ->
let attribute_map =
AttributeMapDomain.add_attribute
(AccessPath.of_id ret_id ret_typ)
Attribute.unconditionally_owned
astate.attribute_map in
{ astate with attribute_map; }
| None -> astate
else else
astate in astate in
begin begin

@ -12,3 +12,5 @@ open! IStd
let is_custom_init _ _ = false let is_custom_init _ _ = false
let is_logging_method _ = false let is_logging_method _ = false
let is_graphql_constructor _ = false

@ -12,3 +12,5 @@ open! IStd
val is_custom_init : Tenv.t -> Procname.t -> bool val is_custom_init : Tenv.t -> Procname.t -> bool
val is_logging_method : Procname.t -> bool val is_logging_method : Procname.t -> bool
val is_graphql_constructor : Procname.t -> bool

Loading…
Cancel
Save