From c6f7181e910b6b2ff1346b5486a31be87b1da5af Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 1 Jan 2019 12:14:56 -0200 Subject: No more LUA_ERRGCMM errors Errors in finalizers (__gc metamethods) are never propagated. Instead, they generate a warning. --- lstate.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index b3e9ec60..7f6475a8 100644 --- a/lstate.c +++ b/lstate.c @@ -409,3 +409,10 @@ LUA_API void lua_close (lua_State *L) { } +void luaE_warning (lua_State *L, const char *msg) { + lua_WarnFunction wf = G(L)->warnf; + if (wf != NULL) + wf(&G(L)->ud_warn, msg); +} + + -- cgit v1.2.3-55-g6feb