shithub: scc

Download patch

ref: 81da8e31a5ccc1c0a12f4a3a3fd167a832e55b8b
parent: 409eba3f49437859eaa24909067891f775c7ec01
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Apr 22 04:45:30 EDT 2014

Evaluate expressions in compare()

compare() can not deal with comparsions, so the parameter expressions must
be evaluated before of doing anything else.

--- a/expr.c
+++ b/expr.c
@@ -230,6 +230,8 @@
 static Node *
 compare(char op, Node *np1, Node *np2)
 {
+	np1 = eval(np1);
+	np2 = eval(np2);
 	switch (np1->typeop) {
 	case INT: case FLOAT:
 		switch (np1->typeop) {
--