mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
move ctrl-c checks into VM_INTERRUPT
This commit is contained in:
parent
58c5c601aa
commit
2578a9a342
1 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue