blob: 5eb0975388b6aaac5057e775680864aa6531350b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
(* TEST
flags = "-g"
ocamlrunparam += ",b=1"
*)
(* #11436: bad backtrace for out-of-bounds exception *)
let xs = [| 0; 1; 2 |]
let [@inline never] bad_bound_fn x =
!x + xs.(100)
let _ =
try
ignore (Sys.opaque_identity (bad_bound_fn (ref 0)));
with exn ->
Printf.printf "Uncaught exception %s\n" (Printexc.to_string exn);
Printexc.print_backtrace stdout;
print_endline "OK"
|