Skip to content

Commit 09f63d4

Browse files
committed
Remove unused code in interval domains (PR #1739, #1804)
1 parent 2a85624 commit 09f63d4

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/cdomain/value/cdomains/int/intervalDomain.ml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,6 @@ struct
216216
| Some x, Some y -> (try of_int ik (f ik x y) |> fst with Division_by_zero -> top_of ik)
217217
| _ -> top_of ik
218218

219-
let bitcomp f ik i1 i2 =
220-
match is_bot i1, is_bot i2 with
221-
| true, true -> (bot_of ik,{underflow=false; overflow=false})
222-
| true, _
223-
| _ , true -> raise (ArithmeticOnIntegerBot (Printf.sprintf "%s op %s" (show i1) (show i2)))
224-
| _ ->
225-
match to_int i1, to_int i2 with
226-
| Some x, Some y -> (try of_int ik (f ik x y) with Division_by_zero | Invalid_argument _ -> (top_of ik,{underflow=false; overflow=false}))
227-
| _ -> (top_of ik,{underflow=true; overflow=true})
228-
229219
let min_val_bit_constrained n =
230220
if Ints_t.equal n Ints_t.zero then
231221
Ints_t.neg Ints_t.one
@@ -389,7 +379,7 @@ struct
389379
let range = if Ints_t.compare xl Ints_t.zero>= 0 then Some (Ints_t.zero, Ints_t.min xu b) else Some (Ints_t.max xl (Ints_t.neg b), Ints_t.min (Ints_t.max (pos xl) (pos xu)) b) in
390380
meet ik (bit (fun _ik -> Ints_t.rem) ik x y) range
391381

392-
let rec div ?no_ov ik x y =
382+
let div ?no_ov ik x y =
393383
match x, y with
394384
| None, None -> (bot (),{underflow=false; overflow=false})
395385
| None, _ | _, None -> raise (ArithmeticOnIntegerBot (Printf.sprintf "%s op %s" (show x) (show y)))

src/cdomain/value/cdomains/int/intervalSetDomain.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ struct
461461
let neg ?no_ov = unary_op_with_norm IArith.neg
462462

463463
let div ?no_ov ik x y =
464-
let rec interval_div x y =
464+
let interval_div x y =
465465
let (neg, pos) = IArith.div x y in
466466
let r = List.filter_map Fun.id [neg; pos] in
467467
if leq (of_int ik Ints_t.zero |> fst) [y] then

0 commit comments

Comments
 (0)