Skip to content

Commit

Permalink
Do not repeat constants in intervals in warning outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Dec 28, 2023
1 parent 4d31efa commit 3713f67
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/cdomains/intDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3598,8 +3598,19 @@ module IntDomTupleImpl = struct
)
let to_int = same BI.to_string % mapp2 { fp2 = fun (type a) (module I:SOverflow with type t = a and type int_t = int_t) -> I.to_int }

let pretty () = (fun xs -> text "(" ++ (try List.reduce (fun a b -> a ++ text "," ++ b) xs with Invalid_argument _ -> nil) ++ text ")") % to_list % mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> (* assert sf==I.short; *) I.pretty () } (* NOTE: the version above does something else. also, we ignore the sf-argument here. *)

let pretty () x =
match to_int x with
| Some v -> Pretty.text (BI.to_string v)
| None ->
mapp { fp = fun (type a) (module I:SOverflow with type t = a) -> (* assert sf==I.short; *) I.pretty () } x
|> to_list
|> (fun xs ->
text "(" ++ (
try
List.reduce (fun a b -> a ++ text "," ++ b) xs
with Invalid_argument _ ->
nil)
++ text ")") (* NOTE: the version above does something else. also, we ignore the sf-argument here. *)

let refine_functions ik : (t -> t) list =
let maybe reffun ik domtup dom =
Expand Down

0 comments on commit 3713f67

Please sign in to comment.