diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-24 14:13:13 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-24 14:13:13 +0100 |
commit | eb5fc65aca905ad38bab0dae85dba0f9a56d7766 (patch) | |
tree | 126bf68a7c23e471920f73951ad8cd2326237a5b /src/libstat/stat_config.c | |
parent | 8303b194152ffc02b5079b6bd08f1fecfd43f5d0 (diff) | |
download | rspamd-eb5fc65aca905ad38bab0dae85dba0f9a56d7766.tar.gz rspamd-eb5fc65aca905ad38bab0dae85dba0f9a56d7766.zip |
[Fix] Do not use lightuserdata for traceback
LuaJIT limits lightuserdata usage to 47 bits. On Arm64, this leads to
break of the C <-> Lua interoperability using this type.
This rework has changed traceback function behaviour from lightuserdata
opaque pointer (GString * in particular) to luaL_Buffer.
Issue: #2906
Diffstat (limited to 'src/libstat/stat_config.c')
-rw-r--r-- | src/libstat/stat_config.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c index 101db4fe6..272a64ddf 100644 --- a/src/libstat/stat_config.c +++ b/src/libstat/stat_config.c @@ -189,7 +189,6 @@ rspamd_stat_init (struct rspamd_config *cfg, struct event_base *ev_base) else { /* Call this function to obtain closure */ gint err_idx, ret; - GString *tb; struct rspamd_config **pcfg; lua_pushcfunction (L, &rspamd_lua_traceback); @@ -201,13 +200,9 @@ rspamd_stat_init (struct rspamd_config *cfg, struct event_base *ev_base) rspamd_lua_setclass (L, "rspamd{config}", -1); if ((ret = lua_pcall (L, 1, 1, err_idx)) != 0) { - tb = lua_touserdata (L, -1); msg_err_config ("call to gen_stat_tokens lua " - "script failed (%d): %v", ret, tb); - - if (tb) { - g_string_free (tb, TRUE); - } + "script failed (%d): %s", ret, + lua_tostring (L, -1)); } else { if (lua_type (L, -1) != LUA_TFUNCTION) { |