diff --git a/infer/src/IR/IntLit.re b/infer/src/IR/IntLit.re index 56a24ad3d..55416af67 100644 --- a/infer/src/IR/IntLit.re +++ b/infer/src/IR/IntLit.re @@ -62,7 +62,7 @@ let of_int64_unsigned i unsigned => (unsigned, i, false); let of_int i => of_int64 (Int64.of_int i); -let to_int (_, i, _) => Int64.to_int i; +let to_int (_, i, _) => Int64.to_int_exn i; let null = (false, 0L, true); @@ -94,21 +94,21 @@ let lift binop (unsigned1, i1, ptr1) (unsigned2, i2, ptr2) => ( let lift1 unop (unsigned, i, ptr) => (unsigned, unop i, ptr); -let add i1 i2 => lift Int64.add i1 i2; +let add i1 i2 => lift Int64.(+) i1 i2; -let mul i1 i2 => lift Int64.mul i1 i2; +let mul i1 i2 => lift Int64.( * ) i1 i2; -let div i1 i2 => lift Int64.div i1 i2; +let div i1 i2 => lift Int64.(/) i1 i2; let rem i1 i2 => lift Int64.rem i1 i2; -let logand i1 i2 => lift Int64.logand i1 i2; +let logand i1 i2 => lift Int64.bit_and i1 i2; -let logor i1 i2 => lift Int64.logor i1 i2; +let logor i1 i2 => lift Int64.bit_or i1 i2; -let logxor i1 i2 => lift Int64.logxor i1 i2; +let logxor i1 i2 => lift Int64.bit_xor i1 i2; -let lognot i => lift1 Int64.lognot i; +let lognot i => lift1 Int64.bit_not i; let sub i1 i2 => add i1 (neg i2); diff --git a/infer/src/backend/dom.ml b/infer/src/backend/dom.ml index 27a5347e9..0a2beb168 100644 --- a/infer/src/backend/dom.ml +++ b/infer/src/backend/dom.ml @@ -1560,10 +1560,10 @@ let sigma_partial_meet tenv (sigma1: Prop.sigma) (sigma2: Prop.sigma) : Prop.sig let widening_top = (* nearly max_int but not so close to overflow *) - IntLit.of_int64 Int64.max_int -- IntLit.of_int 1000 + IntLit.of_int64 Int64.max_value -- IntLit.of_int 1000 let widening_bottom = (* nearly min_int but not so close to underflow *) - IntLit.of_int64 Int64.min_int ++ IntLit.of_int 1000 + IntLit.of_int64 Int64.min_value ++ IntLit.of_int 1000 (** {2 Join and Meet for Pi} *) let pi_partial_join tenv mode diff --git a/infer/src/base/Utils.ml b/infer/src/base/Utils.ml index b7bc93986..ad23a3c50 100644 --- a/infer/src/base/Utils.ml +++ b/infer/src/base/Utils.ml @@ -21,6 +21,9 @@ module Fn = Core.Std.Fn module Gc = Core.Std.Gc module In_channel = Core.Std.In_channel module Int = Core.Std.Int +module Int32 = Core.Std.Int32 +module Int63 = Core.Std.Int63 +module Int64 = Core.Std.Int64 module Option = Core.Std.Option module Pid = Core.Std.Pid module Signal = Core.Std.Signal diff --git a/infer/src/base/Utils.mli b/infer/src/base/Utils.mli index 282e964bf..53ebd3d9c 100644 --- a/infer/src/base/Utils.mli +++ b/infer/src/base/Utils.mli @@ -21,6 +21,9 @@ module Fn = Core.Std.Fn module Gc = Core.Std.Gc module In_channel = Core.Std.In_channel module Int = Core.Std.Int +module Int32 = Core.Std.Int32 +module Int63 = Core.Std.Int63 +module Int64 = Core.Std.Int64 module Option = Core.Std.Option module Pid = Core.Std.Pid module Signal = Core.Std.Signal