returning the result of the root thread when it terminates before the child

This commit is contained in:
Alex Shinn 2012-09-17 16:54:17 +09:00
parent 2154f78b13
commit ff74a8928f

2
vm.c
View file

@ -2101,7 +2101,7 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
if (ctx != root_thread) { if (ctx != root_thread) {
if (sexp_context_refuel(root_thread) <= 0) { if (sexp_context_refuel(root_thread) <= 0) {
/* the root already terminated */ /* the root already terminated */
_ARG1 = SEXP_VOID; _ARG1 = sexp_context_result(root_thread);
} else { } else {
/* don't return from child threads */ /* don't return from child threads */
if (sexp_exceptionp(_ARG1)) { if (sexp_exceptionp(_ARG1)) {