From ea8483a07afa5c6385737d10a17343cd028ff4ef Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 24 Mar 2015 22:53:17 +0000 Subject: Fix processing of some stupid expressions. --- src/libutil/expression.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/libutil/expression.c') 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; \ } \ } \ -- cgit v1.2.3