Supressed errors in '__close' generate warnings

This commit is contained in:
Roberto Ierusalimschy
2019-08-16 09:51:54 -03:00
parent a1d8eb2743
commit ca13be9af7
10 changed files with 166 additions and 45 deletions

7
lgc.c
View File

@@ -854,12 +854,7 @@ static void GCTM (lua_State *L) {
L->allowhook = oldah; /* restore hooks */
g->gcrunning = running; /* restore state */
if (unlikely(status != LUA_OK)) { /* error while running __gc? */
const char *msg = (ttisstring(s2v(L->top - 1)))
? svalue(s2v(L->top - 1))
: "error object is not a string";
luaE_warning(L, "error in __gc metamethod (", 1);
luaE_warning(L, msg, 1);
luaE_warning(L, ")", 0);
luaE_warnerror(L, "__gc metamethod");
L->top--; /* pops error object */
}
}