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.
This commit is contained in:
Aurelien DARRAGON 2023-07-13 10:18:04 +02:00 committed by Christopher Faulet
parent 49ddd87d41
commit 2e7d3d2e5c
2 changed files with 2 additions and 2 deletions

View 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 */

View 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;