From: Aurelien DARRAGON Date: Thu, 13 Jul 2023 08:18:04 +0000 (+0200) Subject: BUG/MINOR: hlua: hlua_yieldk ctx argument should support pointers X-Git-Tag: v2.9-dev2~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e7d3d2e5cd74235cecbb7376d346acdd6babffe;p=thirdparty%2Fhaproxy.git BUG/MINOR: hlua: hlua_yieldk ctx argument should support pointers lua_yieldk ctx argument is of type lua_KContext which is typedefed to intptr_t when available so it can be used to store pointers. But the wrapper function hlua_yieldk() passes it as a regular it so it breaks that promise. Changing hlua_yieldk() prototype so that ctx argument is of type lua_KContext. This bug had no functional impact because ctx argument is not being actively used so far. This may be backported to all stable versions anyway. --- diff --git a/include/haproxy/hlua.h b/include/haproxy/hlua.h index 9c9c57a324..3c67ccea84 100644 --- a/include/haproxy/hlua.h +++ b/include/haproxy/hlua.h @@ -60,7 +60,7 @@ int hlua_ref(lua_State *L); void hlua_pushref(lua_State *L, int ref); void hlua_unref(lua_State *L, int ref); struct hlua *hlua_gethlua(lua_State *L); -void hlua_yieldk(lua_State *L, int nresults, int ctx, lua_KFunction k, int timeout, unsigned int flags); +void hlua_yieldk(lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k, int timeout, unsigned int flags); #else /* USE_LUA */ diff --git a/src/hlua.c b/src/hlua.c index ae0d412a4d..d228563e8d 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1407,7 +1407,7 @@ static inline void hlua_sendlog(struct proxy *px, int level, const char *msg) * returned with a timeout and permit to set some flags * is a tick value */ -__LJMP void hlua_yieldk(lua_State *L, int nresults, int ctx, +__LJMP void hlua_yieldk(lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k, int timeout, unsigned int flags) { struct hlua *hlua;