You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6622 Reporter: serp Assigned to:@mshinwell Status: closed (set by @mshinwell on 2016-12-08T11:08:47Z) Resolution: not a bug Priority: normal Severity: feature Version: 4.02.1 Category: runtime system and C interface Monitored by:@gasche
Bug description
test.ml
exception Test_exn;
value f () = raise Test_exn;
external cfun: unit -> unit = "ml_testf";
value exn_fun p = f ();
Callback.register "ml_exn_fun" exn_fun;
cfun ();
void ml_testf(value param) {
value *c = caml_named_value("ml_exn_fun");
caml_callback(*c,Val_int(1));
}
Compile it to byte with -custom option
./test.byte
Fatal error: exception Run.Test_exn
Raised by primitive operation at file "run.ml", line 6, characters 0-7
======
ocaml-4.01 output
Fatal error: exception Run.Test_exn
Raised at file "run.ml", line 2, characters 19-27
Called from file "run.ml", line 6, characters 0-7
The text was updated successfully, but these errors were encountered:
This appears to happen because a toplevel module initialiser is raising an exception that is caught by the default handler inside caml_startup_code. #953 provides a solution to this problem if it is desired to catch such exceptions.
Original bug ID: 6622
Reporter: serp
Assigned to: @mshinwell
Status: closed (set by @mshinwell on 2016-12-08T11:08:47Z)
Resolution: not a bug
Priority: normal
Severity: feature
Version: 4.02.1
Category: runtime system and C interface
Monitored by: @gasche
Bug description
test.ml
exception Test_exn;
value f () = raise Test_exn;
external cfun: unit -> unit = "ml_testf";
value exn_fun p = f ();
Callback.register "ml_exn_fun" exn_fun;
cfun ();
c_stub.c:
#include <caml/mlvalues.h>
#include <caml/callback.h>
void ml_testf(value param) {
value *c = caml_named_value("ml_exn_fun");
caml_callback(*c,Val_int(1));
}
Compile it to byte with -custom option
./test.byte
Fatal error: exception Run.Test_exn
Raised by primitive operation at file "run.ml", line 6, characters 0-7
======
ocaml-4.01 output
Fatal error: exception Run.Test_exn
Raised at file "run.ml", line 2, characters 19-27
Called from file "run.ml", line 6, characters 0-7
The text was updated successfully, but these errors were encountered: