From cf2eba666e6b959a9705de27c0203a2aad93c7b9 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Wed, 16 Oct 2019 18:36:16 -0700 Subject: [PATCH] Add default case to lua kernel code Some platforms, e.g. FreeBSD, support user space setjmp semantics in kernel. Reviewed-by: Igor Kozhukhov Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Matt Macy Closes #9450 --- module/lua/ldo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/lua/ldo.c b/module/lua/ldo.c index 59d0b6a2c..3b0ece171 100644 --- a/module/lua/ldo.c +++ b/module/lua/ldo.c @@ -46,6 +46,7 @@ #ifdef _KERNEL +#ifdef __linux__ #if defined(__i386__) #define JMP_BUF_CNT 6 #elif defined(__x86_64__) @@ -85,6 +86,11 @@ void longjmp (label_t * buf) { for (;;); } #endif +#else +#define LUAI_THROW(L,c) longjmp((c)->b, 1) +#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } +#define luai_jmpbuf jmp_buf +#endif #else /* _KERNEL */