summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.c
diff options
context:
space:
mode:
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r--grammar/rainerscript.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index abf9dd34..fcc3ed6f 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -3068,12 +3068,15 @@ cnfexprOptimize(struct cnfexpr *expr)
expr->r = exprswap;
}
}
- if(expr->l->nodetype == 'V') {
- expr = cnfexprOptimize_CMP_var(expr);
- }
if(expr->r->nodetype == 'A') {
cnfexprOptimize_CMPEQ_arr((struct cnfarray *)expr->r);
}
+ /* This should be evaluated last because it may change expr
+ * to a function.
+ */
+ if(expr->l->nodetype == 'V') {
+ expr = cnfexprOptimize_CMP_var(expr);
+ }
break;
case CMP_LE:
case CMP_GE: