luaA_dofunction_on_error: call luaL_tolstring on error

This prevents a follow-up error through lua_concat, in case the error is
not a string.

Ref: https://github.com/awesomeWM/awesome/issues/301
This commit is contained in:
Daniel Hahler 2015-08-01 18:23:52 +02:00
parent 65e9d6d59f
commit 5c446c9c09
1 changed files with 4 additions and 0 deletions

4
luaa.c
View File

@ -323,6 +323,10 @@ luaA_panic(lua_State *L)
static int
luaA_dofunction_on_error(lua_State *L)
{
#if LUA_VERSION_NUM >= 502
/* Convert error to string, to prevent a follow-up error with lua_concat. */
luaL_tolstring(L, -1, NULL);
#endif
/* duplicate string error */
lua_pushvalue(L, -1);
/* emit error signal */