You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/analyses/baseInvariant.ml
-10Lines changed: 0 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -291,12 +291,6 @@ struct
291
291
(* inverse values for binary operation a `op` b == c *)
292
292
(* ikind is the type of a for limiting ranges of the operands a, b. The only binops which can have different types for a, b are Shiftlt, Shiftrt (not handled below; don't use ikind to limit b there). *)
293
293
letinv_bin_int (a, b) ikindcop=
294
-
letwarn_and_top_on_zerox=
295
-
ifID.equal_to Z.zero x =`Eqthen
296
-
ID.top_of ikind
297
-
else
298
-
x
299
-
in
300
294
letmeet_bina'b'= id_meet_down ~old:a ~c:a', id_meet_down ~old:b ~c:b' in
301
295
letmeet_comoi=(* commutative *)
302
296
try
@@ -320,8 +314,6 @@ struct
320
314
(refine_by a b, refine_by b a)
321
315
|MinusA -> meet_non ID.add ID.sub
322
316
|Div ->
323
-
(* If b must be zero, we have must UB *)
324
-
let b = warn_and_top_on_zero b in
325
317
(* Integer division means we need to add the remainder, so instead of just `a = c*b` we have `a = c*b + a%b`.
326
318
* However, a%b will give [-b+1, b-1] for a=top, but we only want the positive/negative side depending on the sign of c*b.
327
319
* If c*b = 0 or it can be positive or negative, we need the full range for the remainder. *)
@@ -335,8 +327,6 @@ struct
335
327
in
336
328
meet_bin (ID.add (ID.mul b c) rem) (ID.div (ID.sub a rem) c)
337
329
|Mod -> (* a % b == c *)
338
-
(* If b must be zero, we have must UB *)
339
-
let b = warn_and_top_on_zero b in
340
330
(* a' = a/b*b + c and derived from it b' = (a-c)/(a/b)
341
331
* The idea is to formulate a' as quotient * divisor + remainder. *)
0 commit comments