shithub: scc

Download patch

ref: 5654476dce2255a26d4082d273fa4b654ae2513a
parent: 53524f0343fd7d547953ab39b09f336d661d4d88
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Jan 8 07:46:18 EST 2016

Convert array() to use new fields in type

--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -488,7 +488,7 @@
 	Type *tp;
 	Node *np;
 
-	if (BTYPE(lp) != INT && BTYPE(rp) != INT)
+	if (!lp->type->integer && !rp->type->integer)
 		error("array subscript is not an integer");
 	np = arithmetic(OADD, decay(lp), decay(rp));
 	tp = np->type;