diff --git a/infer/src/bufferoverrun/absLoc.ml b/infer/src/bufferoverrun/absLoc.ml index e441004aa..dbb8eb135 100644 --- a/infer/src/bufferoverrun/absLoc.ml +++ b/infer/src/bufferoverrun/absLoc.ml @@ -127,12 +127,16 @@ module Allocsite = struct end module Loc = struct + type field_typ = Typ.t option + + let compare_field_typ _ _ = 0 + include (* Enforce invariants on Field and StarField, see Symb.mli *) ( struct type t = | Var of Var.t | Allocsite of Allocsite.t - | Field of {prefix: t; fn: Typ.Fieldname.t; typ: Typ.t option} + | Field of {prefix: t; fn: Typ.Fieldname.t; typ: field_typ} | StarField of {prefix: t; last_field: Typ.Fieldname.t} [@@deriving compare] @@ -173,7 +177,7 @@ module Loc = struct type t = private | Var of Var.t | Allocsite of Allocsite.t - | Field of {prefix: t; fn: Typ.Fieldname.t; typ: Typ.t option} + | Field of {prefix: t; fn: Typ.Fieldname.t; typ: field_typ} | StarField of {prefix: t; last_field: Typ.Fieldname.t} [@@deriving compare] diff --git a/infer/src/bufferoverrun/symb.ml b/infer/src/bufferoverrun/symb.ml index 91450abea..8b85ff665 100644 --- a/infer/src/bufferoverrun/symb.ml +++ b/infer/src/bufferoverrun/symb.ml @@ -27,12 +27,16 @@ module SymbolPath = struct let compare_deref_kind _ _ = 0 + type field_typ = Typ.t option + + let compare_field_typ _ _ = 0 + include (* Enforce invariants on Field and StarField *) ( struct type partial = | Pvar of Pvar.t | Deref of deref_kind * partial - | Field of {fn: Typ.Fieldname.t; prefix: partial; typ: Typ.t option} + | Field of {fn: Typ.Fieldname.t; prefix: partial; typ: field_typ} | Callsite of {ret_typ: Typ.t; cs: CallSite.t} | StarField of {last_field: Typ.Fieldname.t; prefix: partial} [@@deriving compare] @@ -76,7 +80,7 @@ module SymbolPath = struct type partial = private | Pvar of Pvar.t | Deref of deref_kind * partial - | Field of {fn: Typ.Fieldname.t; prefix: partial; typ: Typ.t option} + | Field of {fn: Typ.Fieldname.t; prefix: partial; typ: field_typ} | Callsite of {ret_typ: Typ.t; cs: CallSite.t} | StarField of {last_field: Typ.Fieldname.t; prefix: partial} [@@deriving compare]