We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc3eb0a commit c95ebf2Copy full SHA for c95ebf2
src/lcoco.c
@@ -535,7 +535,10 @@ static inline void coco_switch(coco_ctx from, coco_ctx to)
535
#endif
536
537
#define COCO_FILL(coco, NL, mainfunc) \
538
- getcontext(&coco->ctx); \
+ if(getcontext(&coco->ctx) < 0) { \
539
+ luaL_error(OL, "getcontext() failed! ucontext is broken on this system."); \
540
+ return NULL; \
541
+ } \
542
coco->ctx.uc_link = NULL; /* We never exit from coco_main. */ \
543
coco->ctx.uc_stack.ss_sp = coco->allocptr; \
544
coco->ctx.uc_stack.ss_size = (char *)coco - (char *)(coco->allocptr); \
0 commit comments