From eeeb660120331dca9464002276c8d97df14901da Mon Sep 17 00:00:00 2001 From: bakpakin Date: Mon, 3 Jul 2017 16:15:16 -0400 Subject: [PATCH] Can only enter pending threads. --- core/vm.c | 5 ++--- gsttests/basic.gst | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/vm.c b/core/vm.c index b10c1f31..e93f4574 100644 --- a/core/vm.c +++ b/core/vm.c @@ -363,9 +363,8 @@ int gst_continue(Gst *vm) { temp = gst_wrap_thread(vm->thread->parent); } if (temp.type == GST_THREAD) { - if (temp.data.thread->status == GST_THREAD_DEAD || - temp.data.thread->status == GST_THREAD_ERROR) - gst_error(vm, "cannot enter dead thread"); + if (temp.data.thread->status != GST_THREAD_PENDING) + gst_error(vm, "can only enter pending thread"); } gst_frame_ret(stack) = pc[1]; vm->thread->status = GST_THREAD_PENDING; diff --git a/gsttests/basic.gst b/gsttests/basic.gst index 3ffcaead..9ee0bb99 100644 --- a/gsttests/basic.gst +++ b/gsttests/basic.gst @@ -104,4 +104,5 @@ # report -(print num-tests-passed " of " num-tests-run " tests passed") \ No newline at end of file +(print "\n" num-tests-passed " of " num-tests-run " tests passed\n") +(if (not (= num-tests-passed num-tests-run)) (exit! 1)) \ No newline at end of file