Probleme de stack underflow lorsqu'un thread termine sur une exception

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2004 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1998-06-29 14:44:36 +00:00
parent c8c71bc821
commit 78fdb79908
2 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,7 @@ let sieve primes=
(* On elimine de la sortie ceux qui sont des multiples de n *)
while true do
let m = Event.sync (Event.receive inpout) in
(* print_int n; print_string ": "; print_int m; print_newline(); *)
(* print_int n; print_string ": "; print_int m; print_newline(); *)
if (m mod n) = 0
then ()
else ((Event.sync (Event.send output m));())

View File

@ -195,11 +195,12 @@ value thread_new(value clos) /* ML */
/* Set up a return frame that pretends we're applying clos to ().
This way, when this thread is activated, the RETURN will take us
to the entry point of the closure. */
th->sp -= 4;
th->sp[0] = Val_unit;
th->sp -= 5;
th->sp[0] = Val_unit; /* dummy local to be popped by RETURN 1 */
th->sp[1] = (value) Code_val(clos);
th->sp[2] = clos;
th->sp[3] = Val_long(0); /* no extra args */
th->sp[4] = Val_unit; /* the () argument */
/* Fake a C call frame */
th->sp--;
th->sp[0] = Val_unit; /* a dummy environment */