Skip to content

Commit e6f1fed

Browse files
authored
flambda-backend: Handle arithmetic overflow in select_addr (oxcaml#570)
1 parent dab7209 commit e6f1fed

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(* TEST
2+
* arch_amd64
3+
*)
4+
5+
let[@inline never][@local never] f n =
6+
let n = Int64.of_int n in
7+
let open Int64 in
8+
to_int (add n (of_int Int.min_int))
9+
10+
let _ = Printf.printf "0x%x\n%!" (f 1)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0x4000000000000001

0 commit comments

Comments
 (0)