From: Vsevolod Stakhov Date: Tue, 24 Mar 2015 13:49:13 +0000 (+0000) Subject: Fix inversion logic. X-Git-Tag: 0.9.0~439 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=21d32da6a5200dde3dad32ea40721ff2f1679419;p=rspamd.git Fix inversion logic. --- diff --git a/src/libutil/expression.c b/src/libutil/expression.c index 77627becf..06a3af8e8 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -595,6 +595,13 @@ rspamd_process_expression (struct rspamd_expression *expr, gpointer data) st_elt[0]->flags |= RSPAMD_EXPR_FLAG_NEGATE; } + if (st_elt[0]->flags & RSPAMD_EXPR_FLAG_PROCESSED) { + /* Inverse the value */ + if ((st_elt[0]->flags & RSPAMD_EXPR_FLAG_NEGATE)) { + st_elt[0]->value = !st_elt[0]->value; + } + } + rspamd_expr_stack_push (expr, st_elt[0]); break; case OP_OR: