From 3b79a063b6e9525e4ef6d9bce57cae633d3f9b84 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 7 Jan 2006 05:39:40 +0000 Subject: [PATCH] finally, a correct fix --- compiler/libpc300/sc3.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/libpc300/sc3.c b/compiler/libpc300/sc3.c index 02d4bc96..4e988e3f 100755 --- a/compiler/libpc300/sc3.c +++ b/compiler/libpc300/sc3.c @@ -356,10 +356,6 @@ static int skim(int *opstr,void (*testfunc)(int),int dropval,int endval, for ( ;; ) { lvalue=plnge1(hier,lval); /* evaluate left expression */ - if (!lvalue && sc_intest && (lval->ident==iARRAY && lval->ident==iREFARRAY)) { - error(33, lval->sym ? (lval->sym->name ? lval->sym->name : "-unknown") : "-unknown-"); /* array was not indexed in an expression */ - } - allconst= allconst && (lval->ident==iCONSTEXPR); if (allconst) { if (hits) { @@ -379,7 +375,13 @@ static int skim(int *opstr,void (*testfunc)(int),int dropval,int endval, droplab=getlabel(); } /* if */ dropout(lvalue,testfunc,droplab,lval); + if (!lvalue && sc_intest && (lval->ident==iARRAY || lval->ident==iREFARRAY)) { + error(33, lval->sym ? (lval->sym->name ? lval->sym->name : "-unknown") : "-unknown-"); /* array was not indexed in an expression */ + } } else if (hits) { /* no (more) identical operators */ + if (!lvalue && sc_intest && (lval->ident==iARRAY || lval->ident==iREFARRAY)) { + error(33, lval->sym ? (lval->sym->name ? lval->sym->name : "-unknown") : "-unknown-"); /* array was not indexed in an expression */ + } dropout(lvalue,testfunc,droplab,lval); /* found at least one operator! */ ldconst(endval,sPRI); jumplabel(endlab=getlabel());