Skip to content

Commit

Permalink
Add auto-deriving functions for TaintAccessPath.t
Browse files Browse the repository at this point in the history
Summary:
So that `TaintAccessPath.t` can be used in `target.ml` to define parameterized
callables in the follow-ups.

Reviewed By: arthaud

Differential Revision: D64152389

fbshipit-source-id: b4ad977842da3561180da42d5d69b29e5af3fd1c
  • Loading branch information
Tianhan Lu authored and facebook-github-bot committed Oct 11, 2024
1 parent 4dae77a commit 88ddcf8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion source/domains/abstractTreeDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ module StringSet = Set.Make (String)

module Label = struct
module T = struct
open Core

type t =
| AnyIndex
| Index of string
| Field of string
[@@deriving ord, eq]
[@@deriving ord, eq, sexp, hash]

type path = t list
end
Expand Down
2 changes: 1 addition & 1 deletion source/domains/abstractTreeDomain.mli
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Label : sig
| AnyIndex
| Index of string
| Field of string
[@@deriving show, eq]
[@@deriving show, eq, sexp, hash]

type path = t list [@@deriving show]

Expand Down
8 changes: 7 additions & 1 deletion source/domains/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
(name abstract)
(public_name pyrelib.domains)
(preprocess
(pps ppx_deriving.eq ppx_deriving.show ppx_deriving.ord))
(pps
ppx_deriving.eq
ppx_deriving.show
ppx_deriving.ord
ppx_hash
ppx_sexp_conv
ppx_sexp_message))
(libraries core ppx_deriving))
4 changes: 2 additions & 2 deletions source/interprocedural/taintAccessPath.ml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ let normalize_parameters parameters =


module Path = struct
type t = Abstract.TreeDomain.Label.t list
type t = Abstract.TreeDomain.Label.t list [@@deriving compare, sexp, hash]

let pp = Abstract.TreeDomain.Label.pp_path

Expand Down Expand Up @@ -373,7 +373,7 @@ type t = {
root: Root.t;
path: Path.t;
}
[@@deriving compare]
[@@deriving compare, eq, sexp, hash]

let pp formatter { root; path } = Format.fprintf formatter "%a%a" Root.pp root Path.pp path

Expand Down
2 changes: 1 addition & 1 deletion source/interprocedural/taintAccessPath.mli
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type t = {
root: Root.t;
path: Path.t;
}
[@@deriving compare]
[@@deriving compare, eq, sexp, hash]

val pp : Format.formatter -> t -> unit

Expand Down

0 comments on commit 88ddcf8

Please sign in to comment.