From: Aurelien DARRAGON Date: Fri, 8 Sep 2023 17:29:08 +0000 (+0200) Subject: BUG/MINOR: hlua/init: coroutine may not resume itself X-Git-Tag: v2.9-dev6~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1115fc348ec4a7d25ecc316ccc41e2f00c95259c;p=thirdparty%2Fhaproxy.git BUG/MINOR: hlua/init: coroutine may not resume itself It's not supported to call lua_resume with and designating the same lua coroutine. It didn't cause visible bugs so far because Lua 5.3 used to be more permissive about this, and moreover, yielding is not involved during the hlua init state. But this is wrong usage, and the doc clearly specifies that the argument can be NULL when there is no such coroutine, which is the case here. This should be backported in every stable versions. --- diff --git a/src/hlua.c b/src/hlua.c index b3c1b5da5b..e125eff828 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -12872,9 +12872,9 @@ int hlua_post_init_state(lua_State *L) hlua_unref(L, init->function_ref); #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 504 - ret = lua_resume(L, L, 0, &nres); + ret = lua_resume(L, NULL, 0, &nres); #else - ret = lua_resume(L, L, 0); + ret = lua_resume(L, NULL, 0); #endif kind = NULL; switch (ret) {