1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-29 03:19:54 +00:00
When resuming a fiber with a child, the root fiber was set incorrectly.
This commit is contained in:
Calvin Rose 2020-03-05 19:18:45 -06:00
parent 8f1527712e
commit 16202216b2

View File

@ -1262,10 +1262,12 @@ JanetSignal janet_continue(JanetFiber *fiber, Janet in, Janet *out) {
/* Continue child fiber if it exists */
if (fiber->child) {
if (janet_vm_root_fiber == NULL) janet_vm_root_fiber = fiber;
JanetFiber *child = fiber->child;
janet_vm_stackn++;
JanetSignal sig = janet_continue(child, in, &in);
janet_vm_stackn--;
if (janet_vm_root_fiber == fiber) janet_vm_root_fiber = NULL;
if (sig != JANET_SIGNAL_OK && !(child->flags & (1 << sig))) {
*out = in;
return sig;