Skip to content

Commit

Permalink
Replace %raise by %reraise (rebased version of this patch from 4.09)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell committed Jan 23, 2020
1 parent ff469d3 commit 50e9490
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 12 deletions.
2 changes: 1 addition & 1 deletion stdlib/stdlib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let () =
register_named_value "Pervasives.array_bound_error"
(Invalid_argument "index out of bounds")

external raise : exn -> 'a = "%raise"
external raise : exn -> 'a = "%reraise"
external raise_notrace : exn -> 'a = "%raise_notrace"

let failwith s = raise(Failure s)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/stdlib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

(** {1 Exceptions} *)

external raise : exn -> 'a = "%raise"
external raise : exn -> 'a = "%reraise"
(** Raise the given exception value *)

external raise_notrace : exn -> 'a = "%raise_notrace"
Expand Down
48 changes: 45 additions & 3 deletions testsuite/tests/backtrace/backtrace2.byte.reference
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,32 @@ Uncaught exception Invalid_argument("index out of bounds")
Raised by primitive operation at file "backtrace2.ml", line 67, characters 14-22
test_Not_found
Uncaught exception Not_found
Raised at file "hashtbl.ml", line 537, characters 19-28
Raised at file "backtrace2.ml", line 41, characters 24-33
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 43, characters 6-11
Re-raised at file "hashtbl.ml", line 537, characters 19-28
Called from file "backtrace2.ml", line 48, characters 9-42
Re-raised at file "backtrace2.ml", line 48, characters 67-70
Called from file "backtrace2.ml", line 67, characters 11-23
Uncaught exception Not_found
Raised at file "backtrace2.ml", line 52, characters 24-33
Raised at file "backtrace2.ml", line 41, characters 24-33
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 43, characters 6-11
Re-raised at file "hashtbl.ml", line 537, characters 19-28
Called from file "backtrace2.ml", line 48, characters 9-42
Re-raised at file "backtrace2.ml", line 48, characters 67-70
Called from file "backtrace2.ml", line 67, characters 11-23
Re-raised at file "hashtbl.ml", line 537, characters 19-28
Called from file "backtrace2.ml", line 55, characters 8-41
Re-raised at file "backtrace2.ml", line 52, characters 24-33
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Expand All @@ -50,7 +70,29 @@ Called from file "camlinternalLazy.ml", line 31, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 36, characters 10-11
Called from file "backtrace2.ml", line 67, characters 11-23
Uncaught exception Not_found
Raised at file "hashtbl.ml", line 537, characters 19-28
Raised at file "backtrace2.ml", line 41, characters 24-33
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 43, characters 6-11
Re-raised at file "hashtbl.ml", line 537, characters 19-28
Called from file "backtrace2.ml", line 48, characters 9-42
Re-raised at file "backtrace2.ml", line 48, characters 67-70
Called from file "backtrace2.ml", line 67, characters 11-23
Re-raised at file "hashtbl.ml", line 537, characters 19-28
Called from file "backtrace2.ml", line 55, characters 8-41
Re-raised at file "backtrace2.ml", line 52, characters 24-33
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "camlinternalLazy.ml", line 31, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 36, characters 10-11
Called from file "backtrace2.ml", line 67, characters 11-23
Re-raised at file "hashtbl.ml", line 537, characters 19-28
Called from file "backtrace2.ml", line 55, characters 8-41
Re-raised at file "camlinternalLazy.ml", line 35, characters 62-63
Called from file "camlinternalLazy.ml", line 31, characters 17-27
Expand Down
48 changes: 45 additions & 3 deletions testsuite/tests/backtrace/backtrace2.opt.reference
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,32 @@ Uncaught exception Invalid_argument("index out of bounds")
Raised by primitive operation at file "backtrace2.ml", line 67, characters 14-22
test_Not_found
Uncaught exception Not_found
Raised at file "hashtbl.ml", line 537, characters 13-28
Raised at file "backtrace2.ml", line 41, characters 18-33
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 43, characters 6-11
Re-raised at file "hashtbl.ml", line 537, characters 13-28
Called from file "backtrace2.ml", line 48, characters 9-42
Re-raised at file "backtrace2.ml", line 48, characters 61-70
Called from file "backtrace2.ml", line 67, characters 11-23
Uncaught exception Not_found
Raised at file "backtrace2.ml", line 52, characters 18-33
Raised at file "backtrace2.ml", line 41, characters 18-33
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 43, characters 6-11
Re-raised at file "hashtbl.ml", line 537, characters 13-28
Called from file "backtrace2.ml", line 48, characters 9-42
Re-raised at file "backtrace2.ml", line 48, characters 61-70
Called from file "backtrace2.ml", line 67, characters 11-23
Re-raised at file "hashtbl.ml", line 537, characters 13-28
Called from file "backtrace2.ml", line 55, characters 8-41
Re-raised at file "backtrace2.ml", line 52, characters 18-33
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Expand All @@ -50,7 +70,29 @@ Called from file "camlinternalLazy.ml", line 31, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 36, characters 4-11
Called from file "backtrace2.ml", line 67, characters 11-23
Uncaught exception Not_found
Raised at file "hashtbl.ml", line 537, characters 13-28
Raised at file "backtrace2.ml", line 41, characters 18-33
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 41, characters 43-52
Called from file "backtrace2.ml", line 43, characters 6-11
Re-raised at file "hashtbl.ml", line 537, characters 13-28
Called from file "backtrace2.ml", line 48, characters 9-42
Re-raised at file "backtrace2.ml", line 48, characters 61-70
Called from file "backtrace2.ml", line 67, characters 11-23
Re-raised at file "hashtbl.ml", line 537, characters 13-28
Called from file "backtrace2.ml", line 55, characters 8-41
Re-raised at file "backtrace2.ml", line 52, characters 18-33
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "backtrace2.ml", line 52, characters 43-52
Called from file "camlinternalLazy.ml", line 31, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 36, characters 4-11
Called from file "backtrace2.ml", line 67, characters 11-23
Re-raised at file "hashtbl.ml", line 537, characters 13-28
Called from file "backtrace2.ml", line 55, characters 8-41
Re-raised at file "camlinternalLazy.ml", line 35, characters 56-63
Called from file "camlinternalLazy.ml", line 31, characters 17-27
Expand Down
9 changes: 8 additions & 1 deletion testsuite/tests/backtrace/backtrace3.byte.reference
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ Called from file "backtrace3.ml", line 20, characters 4-11
Re-raised at file "backtrace3.ml", line 47, characters 51-55
Called from file "backtrace3.ml", line 54, characters 11-23
Uncaught exception Backtrace3.Error("h")
Raised at file "backtrace3.ml", line 50, characters 16-17
Raised at file "backtrace3.ml", line 16, characters 21-32
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 20, characters 4-11
Re-raised at file "backtrace3.ml", line 50, characters 16-17
Called from file "backtrace3.ml", line 54, characters 11-23
Uncaught exception Invalid_argument("index out of bounds")
Raised by primitive operation at file "backtrace3.ml", line 54, characters 14-22
9 changes: 8 additions & 1 deletion testsuite/tests/backtrace/backtrace3.opt.reference
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ Called from file "backtrace3.ml", line 20, characters 4-11
Re-raised at file "backtrace3.ml", line 47, characters 45-55
Called from file "backtrace3.ml", line 54, characters 11-23
Uncaught exception Backtrace3.Error("h")
Raised at file "backtrace3.ml", line 50, characters 10-17
Raised at file "backtrace3.ml", line 16, characters 16-32
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 16, characters 42-53
Called from file "backtrace3.ml", line 20, characters 4-11
Re-raised at file "backtrace3.ml", line 50, characters 10-17
Called from file "backtrace3.ml", line 54, characters 11-23
Uncaught exception Invalid_argument("index out of bounds")
Raised by primitive operation at file "backtrace3.ml", line 54, characters 14-22
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Raised at file "backtrace_or_exception.ml", line 24, characters 10-13
Called from file "backtrace_or_exception.ml", line 44, characters 6-10
---------------------------
exception Backtrace_or_exception.Exn
Raised at file "backtrace_or_exception.ml", line 15, characters 10-13
Raised at file "backtrace_or_exception.ml", line 24, characters 10-13
Called from file "backtrace_or_exception.ml", line 44, characters 6-10
Re-raised at file "backtrace_or_exception.ml", line 15, characters 10-13
Called from file "backtrace_or_exception.ml", line 28, characters 8-44
Re-raised at file "backtrace_or_exception.ml", line 31, characters 10-13
Called from file "backtrace_or_exception.ml", line 44, characters 6-10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Raised at file "backtrace_or_exception.ml", line 24, characters 4-13
Called from file "backtrace_or_exception.ml", line 44, characters 6-10
---------------------------
exception Backtrace_or_exception.Exn
Raised at file "backtrace_or_exception.ml", line 15, characters 4-13
Raised at file "backtrace_or_exception.ml", line 24, characters 4-13
Called from file "backtrace_or_exception.ml", line 44, characters 6-10
Re-raised at file "backtrace_or_exception.ml", line 15, characters 4-13
Called from file "backtrace_or_exception.ml", line 28, characters 8-44
Re-raised at file "backtrace_or_exception.ml", line 31, characters 4-13
Called from file "backtrace_or_exception.ml", line 44, characters 6-10
Expand Down

0 comments on commit 50e9490

Please sign in to comment.