No more LUA_ERRGCMM errors

Errors in finalizers (__gc metamethods) are never propagated.
Instead, they generate a warning.
This commit is contained in:
Roberto Ierusalimschy
2019-01-01 12:14:56 -02:00
parent 437a5b07d4
commit c6f7181e91
10 changed files with 143 additions and 109 deletions

4
lapi.c
View File

@@ -1276,10 +1276,8 @@ void lua_setwarnf (lua_State *L, lua_WarnFunction f, void *ud) {
void lua_warning (lua_State *L, const char *msg) {
lua_WarnFunction wf = G(L)->warnf;
lua_lock(L);
if (wf != NULL)
wf(&G(L)->ud_warn, msg);
luaE_warning(L, msg);
lua_unlock(L);
}