Do not compare types of array elements in access paths and access expressions

Reviewed By: jvillard

Differential Revision: D10414107

fbshipit-source-id: 7c51e1726
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent b3cef556b7
commit d8ecfbfc4b

@ -8,10 +8,14 @@
open! IStd open! IStd
module F = Format module F = Format
type typ_ = Typ.t
let compare_typ_ _ _ = 0
type t = type t =
| Base of AccessPath.base | Base of AccessPath.base
| FieldOffset of t * Typ.Fieldname.t | FieldOffset of t * Typ.Fieldname.t
| ArrayOffset of t * Typ.t * t list | ArrayOffset of t * typ_ * t list
| AddressOf of t | AddressOf of t
| Dereference of t | Dereference of t
[@@deriving compare] [@@deriving compare]

@ -19,13 +19,13 @@ module Raw = struct
let equal_base = [%compare.equal: base] let equal_base = [%compare.equal: base]
type access = ArrayAccess of Typ.t * t list | FieldAccess of Typ.Fieldname.t type access = ArrayAccess of typ_ * t list | FieldAccess of Typ.Fieldname.t
and t = base * access list [@@deriving compare] and t = base * access list [@@deriving compare]
let equal_access = [%compare.equal: access] let equal_access = [%compare.equal: access]
let equal_access_list l1 l2 = Int.equal (List.compare compare_access l1 l2) 0 let equal_access_list = [%compare.equal: access list]
let may_pp_typ fmt typ = let may_pp_typ fmt typ =
if Config.debug_level_analysis >= 3 then F.fprintf fmt ":%a" (Typ.pp Pp.text) typ if Config.debug_level_analysis >= 3 then F.fprintf fmt ":%a" (Typ.pp Pp.text) typ

Loading…
Cancel
Save