|
|
|
@ -16,11 +16,11 @@ module BoundEnd = struct
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module SymbolPath = struct
|
|
|
|
|
type c_sym_array_kind = CSymArray_Array | CSymArray_Pointer [@@deriving compare]
|
|
|
|
|
type deref_kind = Deref_ArrayIndex | Deref_CPointer [@@deriving compare]
|
|
|
|
|
|
|
|
|
|
type partial =
|
|
|
|
|
| Pvar of Pvar.t
|
|
|
|
|
| Index of c_sym_array_kind * partial
|
|
|
|
|
| Deref of deref_kind * partial
|
|
|
|
|
| Field of Typ.Fieldname.t * partial
|
|
|
|
|
[@@deriving compare]
|
|
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ module SymbolPath = struct
|
|
|
|
|
|
|
|
|
|
let field p fn = Field (fn, p)
|
|
|
|
|
|
|
|
|
|
let index ~array_kind p = Index (array_kind, p)
|
|
|
|
|
let deref ~deref_kind p = Deref (deref_kind, p)
|
|
|
|
|
|
|
|
|
|
let normal p = Normal p
|
|
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ module SymbolPath = struct
|
|
|
|
|
let rec pp_partial fmt = function
|
|
|
|
|
| Pvar pvar ->
|
|
|
|
|
Pvar.pp_value fmt pvar
|
|
|
|
|
| Index (_, p) ->
|
|
|
|
|
| Deref (_, p) ->
|
|
|
|
|
F.fprintf fmt "%a[*]" pp_partial p
|
|
|
|
|
| Field (fn, p) ->
|
|
|
|
|
F.fprintf fmt "%a.%s" pp_partial p (Typ.Fieldname.to_flat_string fn)
|
|
|
|
@ -61,9 +61,9 @@ module SymbolPath = struct
|
|
|
|
|
let rec represents_multiple_values = function
|
|
|
|
|
| Pvar _ ->
|
|
|
|
|
false
|
|
|
|
|
| Index (CSymArray_Array, _) ->
|
|
|
|
|
| Deref (Deref_ArrayIndex, _) ->
|
|
|
|
|
true
|
|
|
|
|
| Index (CSymArray_Pointer, p)
|
|
|
|
|
| Deref (Deref_CPointer, p)
|
|
|
|
|
(* unsound but avoids many FPs for non-array pointers *)
|
|
|
|
|
| Field (_, p) ->
|
|
|
|
|
represents_multiple_values p
|
|
|
|
|