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:
parent
65e9d6d59f
commit
5c446c9c09
4
luaa.c
4
luaa.c
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue