From 2578a9a342888233e055213d053f3002c6831871 Mon Sep 17 00:00:00 2001 From: Jay Kruer Date: Wed, 15 Jun 2022 12:05:30 -0700 Subject: [PATCH] move ctrl-c checks into VM_INTERRUPT --- VM/src/lvmexecute.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/VM/src/lvmexecute.cpp b/VM/src/lvmexecute.cpp index 15e4f5a5..a8797d5d 100644 --- a/VM/src/lvmexecute.cpp +++ b/VM/src/lvmexecute.cpp @@ -74,6 +74,12 @@ #else #define VM_INTERRUPT() \ { \ + if (sigint_received)\ + { \ + sigint_received = 0; \ + L->status = LUA_SIGINT; \ + goto exit; \ + } \ void (*interrupt)(lua_State*, int) = L->global->cb.interrupt; \ if (LUAU_UNLIKELY(!!interrupt)) \ { /* the interrupt hook is called right before we advance pc */ \ @@ -132,17 +138,11 @@ static void handle_sig(int signum) { #if VM_USE_CGOTO #define VM_CASE(op) CASE_##op: -#define VM_NEXT() \ - if (sigint_received)\ - { sigint_received = 0; L->status = LUA_SIGINT; goto exit; } \ - else goto*(SingleStep ? &&dispatch : kDispatchTable[LUAU_INSN_OP(*pc)]) +#define VM_NEXT() goto*(SingleStep ? &&dispatch : kDispatchTable[LUAU_INSN_OP(*pc)]) #define VM_CONTINUE(op) goto* kDispatchTable[uint8_t(op)] #else #define VM_CASE(op) case op: -#define VM_NEXT() \ - if (sigint_received)\ - { sigint_received = 0; } \ - else goto dispatch +#define VM_NEXT() goto dispatch #define VM_CONTINUE(op) \ dispatchOp = uint8_t(op); \ goto dispatchContinue