aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-01 13:35:13 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-01 13:35:13 +0100
commit6b80e5120a9edeebee4e266fc17c81e2a5ddaf40 (patch)
treef4bd1e271977503db3a4292e201f332aa367ace4 /src/libstat/stat_process.c
parent760522c4da986f19e864da6123ba938f5e7d25d2 (diff)
downloadrspamd-6b80e5120a9edeebee4e266fc17c81e2a5ddaf40.tar.gz
rspamd-6b80e5120a9edeebee4e266fc17c81e2a5ddaf40.zip
[Minor] Add function to get a lua_reference from a string returning a function
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index d8b0a3349..8ac4e499e 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -551,7 +551,7 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
while (cur) {
cb_ref = GPOINTER_TO_INT (cur->data);
- lua_settop (L, 0);
+ gint old_top = lua_gettop (L);
lua_rawgeti (L, LUA_REGISTRYINDEX, cb_ref);
/* Push task and two booleans: is_spam and is_unlearn */
ptask = lua_newuserdata (L, sizeof (*ptask));
@@ -576,13 +576,13 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
lua_tostring (L, 2));
}
- lua_settop (L, 0);
+ lua_settop (L, old_top);
break;
}
}
}
- lua_settop (L, 0);
+ lua_settop (L, old_top);
cur = g_list_next (cur);
}