From 3ab947ce345e9d18ddcda57d8f88b2a9b8f5d267 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Mon, 12 Oct 2015 11:48:36 +0200 Subject: Removal of cchecklink, superseded by AbsInt's Valex tool. --- checklink/Safe32.ml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 checklink/Safe32.ml (limited to 'checklink/Safe32.ml') diff --git a/checklink/Safe32.ml b/checklink/Safe32.ml deleted file mode 100644 index e72563d7..00000000 --- a/checklink/Safe32.ml +++ /dev/null @@ -1,34 +0,0 @@ -(* "Hacker's Delight", section 2.12 *) - -let ( + ) x y = Int32.( - let z = add x y in - (* Overflow occurs iff x and y have same sign and z's sign is different *) - if logand (logxor z x) (logxor z y) < 0l - then raise Exc.Int32Overflow - else z -) - -let ( - ) x y = Int32.( - let z = sub x y in - (* Overflow occurs iff x and y have opposite signs and z and x have - opposite signs *) - if logand (logxor x y) (logxor z x) < 0l - then raise Exc.Int32Overflow - else z -) - -let ( * ) x y = Int32.( - let z = mul x y in - if (x = min_int && y < 0l) || (y <> 0l && div z y <> x) - then raise Exc.Int32Overflow - else z -) - -let to_int i32 = Int32.( - let i = to_int i32 in - if i32 = of_int i - then i - else raise Exc.IntOverflow -) - -let of_int = Int32.of_int -- cgit