commit 834573a: [Minor] Lua_task: Use absolute value when dealing with neural tokens

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jul 15 15:49:08 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-15 16:41:05 +0100
URL: https://github.com/rspamd/rspamd/commit/834573afd5cb9495d12d5945bea07f64a6cae540

[Minor] Lua_task: Use absolute value when dealing with neural tokens

---
 src/lua/lua_task.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 1167edb50..9fe61e07d 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -4449,7 +4449,7 @@ lua_task_process_ann_tokens (lua_State *L)
 					!(rspamd_symcache_item_flags (sres->sym->cache_item) &
 					  SYMBOL_TYPE_NOSTAT)) {
 
-					lua_pushnumber (L, tanh (sres->score));
+					lua_pushnumber (L, fabs (tanh (sres->score)));
 					lua_rawseti (L, 3, offset + 1);
 				}
 			}


More information about the Commits mailing list