]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: hlua_yieldk ctx argument should support pointers
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 13 Jul 2023 08:18:04 +0000 (10:18 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 17 Jul 2023 05:42:47 +0000 (07:42 +0200)
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.

include/haproxy/hlua.h
src/hlua.c

index 9c9c57a324097348328ca357dd7a997418e30898..3c67ccea8442c4c2b75f7fd83e648db9c8e80f71 100644 (file)
@@ -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 */
 
index ae0d412a4deddb955d47ebfd66304223ed19a981..d228563e8d94bac25b7a069095c798965eee5d6e 100644 (file)
@@ -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
  * <timeout> 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;