shithub: scc

Download patch

ref: 8c20c2d40ef87863abdc2e65985dae9088b3a3dd
parent: 327b03d58b8ba6d5d928c338ea8c32e27a2f9c94
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Apr 22 04:39:18 EDT 2014

Evaluate expressions in integerop

integerop can not handle with comparisions, so parameter expressions
must be evaluated before of doing anything else.

--- a/expr.c
+++ b/expr.c
@@ -69,6 +69,8 @@
 static Node *
 integerop(char op, Node *np1, Node *np2)
 {
+	np1 = eval(np1);
+	np2 = eval(np2);
 	if (np1->typeop != INT || np2->typeop != INT)
 		error("operator requires integer operands");
 	typeconv(&np1, &np2);