aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-05-05 17:41:35 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-05-05 17:41:35 +0400
commit12bd5905706b1364fdf0cd33008a630ecaae65c5 (patch)
tree4d72c6178aed35e516a89782b3f1abcf6aeb1d35
parent776cb6c82b310438075155eb61de6f3e5cde6991 (diff)
downloadrspamd-12bd5905706b1364fdf0cd33008a630ecaae65c5.tar.gz
rspamd-12bd5905706b1364fdf0cd33008a630ecaae65c5.zip
* Fix expression optimizator
-rw-r--r--src/plugins/regexp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 8efc013dc..e088e1e02 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -468,7 +468,6 @@ process_regexp_expression (struct expression *expr, struct worker_task *task)
g_queue_free (stack);
return FALSE;
}
- try_optimize = TRUE;
msg_debug ("process_regexp_expression: got operation %c", it->content.operation);
switch (it->content.operation) {
case '!':
@@ -479,12 +478,12 @@ process_regexp_expression (struct expression *expr, struct worker_task *task)
case '&':
op1 = GPOINTER_TO_SIZE (g_queue_pop_head (stack));
op2 = GPOINTER_TO_SIZE (g_queue_pop_head (stack));
- g_queue_push_head (stack, GSIZE_TO_POINTER (op1 && op2));
+ try_optimize = optimize_regexp_expression (&it, stack, op1 && op2);
break;
case '|':
op1 = GPOINTER_TO_SIZE (g_queue_pop_head (stack));
op2 = GPOINTER_TO_SIZE (g_queue_pop_head (stack));
- g_queue_push_head (stack, GSIZE_TO_POINTER (op1 || op2));
+ try_optimize = optimize_regexp_expression (&it, stack, op1 || op2);
break;
default:
it = it->next;