From 5705e69abbecdc20692298c8b5816ddfaf0de79a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 6 Sep 2005 20:36:02 +0000 Subject: [PATCH] Fixed bug where level>1 arrays were walked incorrectly --- compiler/libpc300/sclist.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/libpc300/sclist.c b/compiler/libpc300/sclist.c index 7d24e142..f87d21d7 100755 --- a/compiler/libpc300/sclist.c +++ b/compiler/libpc300/sclist.c @@ -450,9 +450,14 @@ SC_FUNC stringlist *insert_dbgsymbol(symbol *sym) #endif if (sym->ident==iARRAY || sym->ident==iREFARRAY) { symbol *sub; +#if !defined NDEBUG + count = sym->dim.array.level; +#endif strcat(string," [ "); for (sub=sym; sub!=NULL; sub=finddepend(sub)) { - assert(sub->dim.array.level==count++); +#if !defined NDEBUG + assert(sub->dim.array.level==count--); +#endif sprintf(string+strlen(string),"%x:%x ",sub->x.idxtag,sub->dim.array.length); } /* for */ strcat(string,"]");