fix lua crashing after an lua error
This fixes 797613f760
which changed the luaW_pcall code from.
if(lua_pcall(..)) {
...
lua_pop(L, 2);
return;
}
lua_remove(L, error_handler_index);
to
int r = lua_pcall(..);
lua_remove(L, error_handler_index);
if(r) {
...
lua_pop(L, 2);
return;
}
so that three values were removed from the stack in case of an error which caused random segfaults later.
This commit is contained in:
parent
06570d093e
commit
806a388b9d
1 changed files with 1 additions and 1 deletions
|
@ -983,7 +983,7 @@ bool luaW_pcall(lua_State *L, int nArgs, int nRets, bool allow_wml_error)
|
|||
} else {
|
||||
chat_message("Lua caught unknown exception", "");
|
||||
}
|
||||
lua_pop(L, 2);
|
||||
lua_pop(L, 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue