From 6144e89902a765c71364928e53ddd744b89410a8 Mon Sep 17 00:00:00 2001 From: Jay Kruer Date: Thu, 16 Jun 2022 14:17:18 -0700 Subject: [PATCH] wip --- CLI/Repl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CLI/Repl.cpp b/CLI/Repl.cpp index 47882b1e..132a2ee2 100644 --- a/CLI/Repl.cpp +++ b/CLI/Repl.cpp @@ -502,12 +502,12 @@ static void runReplImpl(lua_State* L) } #ifndef _WIN32 +#include void ihandler(lua_State* L, int k) { if (sigint_received) { - // when VM_INTERRUPT sees that the status is non-zero it will - // exit the interpreter loop - lua_setstatus(L,LUA_SIGINT); sigint_received = 0; + std::runtime_error error("Execution interrupted"); + throw error; } }; #endif @@ -522,7 +522,7 @@ static void runRepl() // FIXME: add corresponding windows functionality #ifndef _WIN32 signal(SIGINT, handle_sig); - lua_setinterrupt(L, &ihandler); + lua_callbacks(L)->interrupt = &ihandler; #endif luaL_sandboxthread(L);