From cd4a2c85d9447adcb611930e443d94a1606c1b19 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 24 Mar 2009 13:57:27 +0300 Subject: [PATCH] * Fix expression optimizator --- src/plugins/regexp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index b1f4b4f15e..03080c0103 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -277,6 +277,7 @@ optimize_regexp_expression (struct expression **e, GQueue *stack, gboolean res) if (it->content.operation == '!') { res = !res; it = it->next; + *e = it; continue; } else if (it->content.operation == '&' && res == FALSE) { @@ -353,7 +354,9 @@ process_regexp_item (struct regexp_module_item *item, struct worker_task *task) continue; } } - it = it->next; + if (it) { + it = it->next; + } } if (!g_queue_is_empty (stack)) { op1 = GPOINTER_TO_SIZE (g_queue_pop_head (stack)); -- 2.47.3