'luaD_seterrorobj' should not raise errors
This function can be called unprotected, so it should not raise any kind of errors. (It could raise a memory-allocation error when creating a message).
This commit is contained in:
4
ldebug.c
4
ldebug.c
@@ -832,6 +832,10 @@ l_noret luaG_errormsg (lua_State *L) {
|
||||
L->top.p++; /* assume EXTRA_STACK */
|
||||
luaD_callnoyield(L, L->top.p - 2, 1); /* call it */
|
||||
}
|
||||
if (ttisnil(s2v(L->top.p - 1))) { /* error object is nil? */
|
||||
/* change it to a proper message */
|
||||
setsvalue2s(L, L->top.p - 1, luaS_newliteral(L, "<no error object>"));
|
||||
}
|
||||
luaD_throw(L, LUA_ERRRUN);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user