Skip to content

Commit c95ebf2

Browse files
committed
ucontext is not implemented on some arm systems (all EABI?)
1 parent bc3eb0a commit c95ebf2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lcoco.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,10 @@ static inline void coco_switch(coco_ctx from, coco_ctx to)
535535
#endif
536536

537537
#define COCO_FILL(coco, NL, mainfunc) \
538-
getcontext(&coco->ctx); \
538+
if(getcontext(&coco->ctx) < 0) { \
539+
luaL_error(OL, "getcontext() failed! ucontext is broken on this system."); \
540+
return NULL; \
541+
} \
539542
coco->ctx.uc_link = NULL; /* We never exit from coco_main. */ \
540543
coco->ctx.uc_stack.ss_sp = coco->allocptr; \
541544
coco->ctx.uc_stack.ss_size = (char *)coco - (char *)(coco->allocptr); \

0 commit comments

Comments
 (0)