From: Vsevolod Stakhov Date: Tue, 24 Mar 2015 22:53:17 +0000 (+0000) Subject: Fix processing of some stupid expressions. X-Git-Tag: 0.9.0~430 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ea8483a07afa5c6385737d10a17343cd028ff4ef;p=rspamd.git Fix processing of some stupid expressions. --- 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; \ } \ } \