Minimal fix for #1948 - ev cancel in janet_dobytes

run.c should initialize fibers nicely, but a more general fix is ideal
for top level functions that call into the event loop.
This commit is contained in:
Calvin Rose committed 2026-11-23 19:00:20 -06:00
1 parent b80a5a9d94
commit 618d4e06f1
2 files changed
+7 -1

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@
#include "state.h"
#endif
/* Run a string of code. The return value is a set of error flags, JANET_DO_ERROR_RUNTIME, JANET_DO_ERROR_COMPILE, and JANET_DOR_ERROR_PARSE if
/* Run a string of code. The return value is a set of error flags, JANET_DO_ERROR_RUNTIME, JANET_DO_ERROR_COMPILE, and JANET_DO_ERROR_PARSE if
* any errors were encountered in those phases. More information is printed to stderr. */
int janet_dobytes(JanetTable *env, const uint8_t *bytes, int32_t len, const char *sourcePath, Janet *out) {
JanetParser *parser;
+6
View File
@@ -1562,6 +1562,12 @@ static JanetSignal janet_check_can_resume(JanetFiber *fiber, Janet *out, int is_
*out = janet_wrap_string(str);
return JANET_SIGNAL_ERROR;
}
#ifdef JANET_EV
if (janet_vm.fiber == NULL) {
/* Make sure we don't run root fibers without this flag */
fiber->gc.flags |= JANET_FIBER_EV_GCFLAG_ROOT;
}
#endif
return JANET_SIGNAL_OK;
}