summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-03-15 16:59:40 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-03-15 16:59:40 +0100
commitb097e889a14de1341262e53c70451f67bbe077ab (patch)
tree707bbc27bc5a91b42b3fe0db84576183ce16c29a /grammar/rainerscript.c
parentebda75e574dcb077c0da3ffd8cc4cc6b96c69ed3 (diff)
downloadrsyslog-b097e889a14de1341262e53c70451f67bbe077ab.tar.gz
rsyslog-b097e889a14de1341262e53c70451f67bbe077ab.tar.bz2
rsyslog-b097e889a14de1341262e53c70451f67bbe077ab.zip
bugfix: segfault in expression optimizer
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=423
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r--grammar/rainerscript.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 7ef7bf7f..8a9c9aaa 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -2635,7 +2635,7 @@ cnfexprOptimize_CMP_severity_facility(struct cnfexpr *expr)
/* optimize a comparison with a variable as left-hand operand
* NOTE: Currently support CMP_EQ, CMP_NE only and code NEEDS
- * TO BE CHANGED for other comparisons!
+ * TO BE CHANGED fgr other comparisons!
*/
static inline struct cnfexpr*
cnfexprOptimize_CMP_var(struct cnfexpr *expr)
@@ -2790,10 +2790,10 @@ cnfexprOptimize(struct cnfexpr *expr)
expr->l = expr->r;
expr->r = exprswap;
}
- } else if(expr->l->nodetype == 'V') {
- expr = cnfexprOptimize_CMP_var(expr);
}
- if(expr->r->nodetype == 'A') {
+ if(expr->l->nodetype == 'V') {
+ expr = cnfexprOptimize_CMP_var(expr);
+ } else if(expr->r->nodetype == 'A') {
cnfexprOptimize_CMPEQ_arr((struct cnfarray *)expr->r);
}
break;