Add (non-working) stacktrace code
This commit is contained in:
parent
f5501273e2
commit
cd8a729873
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue