scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 5654476dce2255a26d4082d273fa4b654ae2513a
parent 53524f0343fd7d547953ab39b09f336d661d4d88
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  8 Jan 2016 12:46:18 +0100

Convert array() to use new fields in type

Diffstat:
cc1/expr.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/expr.c b/cc1/expr.c @@ -488,7 +488,7 @@ array(Node *lp, Node *rp) 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;