From: Matthew Macy Date: Thu, 17 Oct 2019 01:36:16 +0000 (-0700) Subject: Add default case to lua kernel code X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf2eba666e6b959a9705de27c0203a2aad93c7b9;p=zfs 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 --- 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 */