From cd8a729873b12b72424f1aea721ab8f3e339fdab Mon Sep 17 00:00:00 2001 From: redfast00 Date: Sun, 19 Sep 2021 04:05:24 +0200 Subject: [PATCH] Add (non-working) stacktrace code --- main/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index 74a5699..4810696 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -159,6 +159,7 @@ extern "C" { static int c_waitframes(lua_State *L) { kill_thread_if_desired(L); + // TODO this is incorrect, fix this int amount = luaL_checkinteger(L, 1); uint64_t destination = amount + framecounter; if (amount >= 2 * FPS) { @@ -227,6 +228,8 @@ lua_State* setup_lua_sandbox(const char* luacode) { int execute_lua_sandbox(lua_State* L) { int ret = lua_pcall(L, 0, 0, 0); if (ret != 0) { + // TODO get full stacktrace + luaL_traceback(L, L, lua_tostring(L, -1), 1); statemap[L]->logger << "CRASH: " << lua_tostring(L, -1) << '\n'; lua_close(L); return 1;