diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-24 22:53:17 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-24 22:53:17 +0000 |
commit | ea8483a07afa5c6385737d10a17343cd028ff4ef (patch) | |
tree | d6b1d0e7200bdb02c134df19020aac8cd92811ae /src/libutil/expression.c | |
parent | 6b1f6fea999cc8477359a1677c64ccb00a4d09e7 (diff) | |
download | rspamd-ea8483a07afa5c6385737d10a17343cd028ff4ef.tar.gz rspamd-ea8483a07afa5c6385737d10a17343cd028ff4ef.zip |
Fix processing of some stupid expressions.
Diffstat (limited to 'src/libutil/expression.c')
-rw-r--r-- | src/libutil/expression.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c index 5c057734c..41b30010b 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -544,10 +544,17 @@ err: (e1) : (e2)) #define CHOOSE_REMAIN(e1, e2, es) ((es) == (e1) ? (e2) : (e1)) #define PROCESS_ELT(expr, e) do { \ + g_assert ((e)->type != ELT_OP); \ if (!((e)->flags & RSPAMD_EXPR_FLAG_PROCESSED)) { \ - (e)->value = (expr)->subr->process (data, (e)->p.atom); \ + if ((e)->type == ELT_ATOM) { \ + (e)->value = (expr)->subr->process (data, (e)->p.atom); \ + } \ + else { \ + (e)->value = (e)->p.lim.val; \ + } \ (e)->flags |= RSPAMD_EXPR_FLAG_PROCESSED; \ if ((e)->flags & RSPAMD_EXPR_FLAG_NEGATE) { \ + (e)->flags &= ~RSPAMD_EXPR_FLAG_NEGATE; \ (e)->value = !(e)->value; \ } \ } \ |