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-0dff7051ff02master
parent
c8c71bc821
commit
78fdb79908
|
@ -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));())
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue