diff --git a/infer/src/backend/buckets.ml b/infer/src/backend/buckets.ml index 11ed8951b..36f27ed9e 100644 --- a/infer/src/backend/buckets.ml +++ b/infer/src/backend/buckets.ml @@ -101,9 +101,9 @@ let check_access access_opt = Some Localise.BucketLevel.b1 | _ -> None -let classify_access desc access_opt = - L.d_strln "Doing classification"; +let classify_access desc access_opt is_nullable = + let default_bucket = if is_nullable then Localise.BucketLevel.b1 else Localise.BucketLevel.b5 in let show_in_message = !Config.show_buckets in match check_access access_opt with - | None -> Localise.error_desc_set_bucket desc Localise.BucketLevel.b5 show_in_message + | None -> Localise.error_desc_set_bucket desc default_bucket show_in_message | Some bucket -> Localise.error_desc_set_bucket desc bucket show_in_message diff --git a/infer/src/backend/buckets.mli b/infer/src/backend/buckets.mli index c03999cf2..8c67c12b0 100644 --- a/infer/src/backend/buckets.mli +++ b/infer/src/backend/buckets.mli @@ -8,5 +8,5 @@ open Utils -(** Classify the bucket of an error desc using Location.access information *) -val classify_access : Localise.error_desc -> Localise.access option -> Localise.error_desc +(** Classify the bucket of an error desc using Location.access and nullable information *) +val classify_access : Localise.error_desc -> Localise.access option -> bool -> Localise.error_desc diff --git a/infer/src/backend/errdesc.ml b/infer/src/backend/errdesc.ml index 054e5737d..b2ec57e3d 100644 --- a/infer/src/backend/errdesc.ml +++ b/infer/src/backend/errdesc.ml @@ -749,7 +749,7 @@ let create_dereference_desc | _ -> desc) | _ -> desc else desc in - if use_buckets then Buckets.classify_access desc access_opt' + if use_buckets then Buckets.classify_access desc access_opt' is_nullable else desc (** explain memory access performed by the current instruction