|
|
|
@ -732,16 +732,16 @@ let create_dereference_desc
|
|
|
|
|
?outermost_array: (outermost_array = false)
|
|
|
|
|
?is_nullable: (is_nullable = false)
|
|
|
|
|
?is_premature_nil: (is_premature_nil = false)
|
|
|
|
|
_de_opt deref_str prop loc =
|
|
|
|
|
de_opt deref_str prop loc =
|
|
|
|
|
let value_str, access_opt =
|
|
|
|
|
explain_dereference_access outermost_array is_nullable _de_opt prop in
|
|
|
|
|
explain_dereference_access outermost_array is_nullable de_opt prop in
|
|
|
|
|
let access_opt' = match access_opt with
|
|
|
|
|
| Some (Localise.Last_accessed _) when outermost_array -> None (* don't report last accessed for arrays *)
|
|
|
|
|
| _ -> access_opt in
|
|
|
|
|
let desc = Localise.dereference_string deref_str value_str access_opt' loc in
|
|
|
|
|
let desc =
|
|
|
|
|
if !Sil.curr_language = Sil.C_CPP && not is_premature_nil then
|
|
|
|
|
match _de_opt with
|
|
|
|
|
match de_opt with
|
|
|
|
|
| Some (Sil.Dpvar pvar)
|
|
|
|
|
| Some (Sil.Dpvaraddr pvar) ->
|
|
|
|
|
(match Prop.get_objc_null_attribute prop (Sil.Lvar pvar) with
|
|
|
|
@ -749,7 +749,7 @@ let create_dereference_desc
|
|
|
|
|
| _ -> desc)
|
|
|
|
|
| _ -> desc
|
|
|
|
|
else desc in
|
|
|
|
|
if use_buckets then Buckets.classify_access desc access_opt' is_nullable
|
|
|
|
|
if use_buckets then Buckets.classify_access desc access_opt' de_opt is_nullable
|
|
|
|
|
else desc
|
|
|
|
|
|
|
|
|
|
(** explain memory access performed by the current instruction
|
|
|
|
@ -865,7 +865,8 @@ let explain_nth_function_parameter use_buckets deref_str prop n pvar_off =
|
|
|
|
|
let arg = fst (list_nth args (n - 1)) in
|
|
|
|
|
let dexp_opt = exp_rv_dexp node arg in
|
|
|
|
|
let dexp_opt' = match dexp_opt with
|
|
|
|
|
| Some de -> Some (dexp_apply_pvar_off de pvar_off)
|
|
|
|
|
| Some de ->
|
|
|
|
|
Some (dexp_apply_pvar_off de pvar_off)
|
|
|
|
|
| None -> None in
|
|
|
|
|
create_dereference_desc ~use_buckets dexp_opt' deref_str prop loc
|
|
|
|
|
with exn when exn_not_timeout exn -> Localise.no_desc)
|
|
|
|
|