From e3748d403bf05f87ddc12d38869321557b99ad45 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 24 Jul 2020 15:15:10 +0100 Subject: [PATCH] [Minor] Allow rspamd_text to be passed --- src/lua/lua_common.c | 2 ++ src/lua/lua_common.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index d53ebbc48c..c658181ee1 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -2479,6 +2479,7 @@ rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc, * - u - lua_userdata, argument - (const char * + void *) - classname + pointer * - b - lua_boolean, argument - gboolean (not bool due to varargs promotion) * - f - lua_function, argument - int - position of the function on stack (not lua_registry) + * - t - lua_text, argument - int - position of the lua_text on stack (not lua_registry) */ while (*argp) { switch (*argp) { @@ -2511,6 +2512,7 @@ rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc, nargs ++; break; case 'f': + case 't': lua_pushvalue (L, va_arg (ap, gint)); nargs ++; break; diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h index 76680cbc59..cc4c9a9d4d 100644 --- a/src/lua/lua_common.h +++ b/src/lua/lua_common.h @@ -594,6 +594,7 @@ gchar *rspamd_lua_get_module_name (lua_State *L); * - u - lua_userdata, argument - (const char * + void *) - classname + pointer * - b - lua_boolean, argument - gboolean (not bool due to varargs promotion) * - f - lua_function, argument - int - position of the function on stack (not lua_registry) + * - t - lua_text, argument - int - position of the lua_text on stack (not lua_registry) * @param L lua state * @param cbref LUA_REGISTRY reference * @param strloc where this function is called from -- 2.47.3