shithub: scc

Download patch

ref: 6fd6dfd8592bc08ea2e4b40893e3d57a44297f44
parent: 02e6ceca3bbaed6ec4120852882e62e464084f01
author: Roberto E. Vargas Caballero <[email protected]>
date: Sun Apr 20 03:02:43 EDT 2014

promote integer types in convert()

integer promotion is done only when no float operands are
implied.

--- a/expr.c
+++ b/expr.c
@@ -48,8 +48,13 @@
 	tp2 = np1->utype;
 	if (tp1 == tp2)
 		return;
-	new1 = new2 = NULL;
+	if (tp1->op == INT && tp2->op == INT) {
+		np1 = promote(np1);
+		np2 = promote(np2);
+	}
+
 	n = tp1->u.size - tp2->u.size;
+	new1 = new2 = NULL;
 
 	if (n > 0)
 		new2 = tp1;