diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-24 17:30:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-24 17:30:00 +0000 |
commit | 4442c05a65fbba59822a99da0138409dc4351618 (patch) | |
tree | dd954b8abfea9c497d08e33bc884fb7c36d2d8e1 /src/libutil/expression.c | |
parent | 2b09e03b9d09372cf8720b86bd346a9b658f0103 (diff) | |
download | rspamd-4442c05a65fbba59822a99da0138409dc4351618.tar.gz rspamd-4442c05a65fbba59822a99da0138409dc4351618.zip |
Fix some priority issues in expressions.
Diffstat (limited to 'src/libutil/expression.c')
-rw-r--r-- | src/libutil/expression.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c index 350a9aebf..5c057734c 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -110,20 +110,22 @@ rspamd_expr_logic_priority (enum rspamd_expression_op op) switch (op) { case OP_NOT: - ret = 5; - break; - case OP_MULT: - case OP_AND: - ret = 4; + ret = 6; break; case OP_PLUS: - case OP_OR: - ret = 3; + ret = 5; break; case OP_GE: case OP_GT: case OP_LE: case OP_LT: + ret = 4; + break; + case OP_MULT: + case OP_AND: + ret = 3; + break; + case OP_OR: ret = 2; break; case OP_OBRACE: @@ -322,6 +324,7 @@ rspamd_parse_expression (const gchar *line, gsize len, len = strlen (line); } + memset (&elt, 0, sizeof (elt)); num_re = rspamd_regexp_cache_create (NULL, "/^\\d+(\\s+|[)]|$)/", NULL, NULL); p = line; |