diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1997-05-15 13:28:08 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1997-05-15 13:28:08 +0000 |
commit | 1f808f4492c94013014004ae4453f932bf8bee83 (patch) | |
tree | 51b0494b37e42774c70cfdde52ddf5dd4001d41d | |
parent | 58d10b597a0bc248ae3c646b84d0209981d220cb (diff) |
pervasives: grouper les 3 arguments de Assert_failure, ca permet une
meilleure propagation des constantes.
pervasives.mli: documentation de Stack_overflow
printexc.ml: affichage de Stack_overflow.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | stdlib/pervasives.ml | 2 | ||||
-rw-r--r-- | stdlib/pervasives.mli | 8 | ||||
-rw-r--r-- | stdlib/printexc.ml | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/stdlib/pervasives.ml b/stdlib/pervasives.ml index 1ae6765a2..1904da847 100644 --- a/stdlib/pervasives.ml +++ b/stdlib/pervasives.ml @@ -21,7 +21,7 @@ let failwith s = raise(Failure s) let invalid_arg s = raise(Invalid_argument s) exception Exit -exception Assert_failure of string * int * int +exception Assert_failure of (string * int * int) (* Comparisons *) diff --git a/stdlib/pervasives.mli b/stdlib/pervasives.mli index bed85812b..2f352ed7d 100644 --- a/stdlib/pervasives.mli +++ b/stdlib/pervasives.mli @@ -53,12 +53,12 @@ type 'a option = None | Some of 'a external raise : exn -> 'a = "%raise" (* Raise the given exception value *) -(*- exception Match_failure of string * int * int *) +(*- exception Match_failure of (string * int * int) *) (* Exception raised when none of the cases of a pattern-matching apply. The arguments are the location of the pattern-matching in the source code (file name, position of first character, position of last character). *) -exception Assert_failure of string * int * int +exception Assert_failure of (string * int * int) (* Exception raised when an assertion fails. The arguments are the location of the pattern-matching in the source code (file name, position of first character, position of last @@ -75,6 +75,10 @@ exception Assert_failure of string * int * int (*- exception Out_of_memory *) (* Exception raised by the garbage collector when there is insufficient memory to complete the computation. *) +(*- exception Stack_overflow *) + (* Exception raised by the bytecode interpreter when the evaluation + stack reaches its maximal size. This often indicates infinite + or excessively deep recursion in the user's program. *) (*- exception Sys_error of string *) (* Exception raised by the input/output functions to report an operating system error. *) diff --git a/stdlib/printexc.ml b/stdlib/printexc.ml index 842088be2..359bfbbdc 100644 --- a/stdlib/printexc.ml +++ b/stdlib/printexc.ml @@ -21,6 +21,8 @@ let prerr_loc file first_char last_char msg = let print_exn = function Out_of_memory -> prerr_string "Out of memory\n" + | Stack_overflow -> + prerr_string "Stack overflow\n" | Match_failure(file, first_char, last_char) -> prerr_loc file first_char last_char "Pattern matching failed"; | Assert_failure(file, first_char, last_char) -> |