Fixed bug where level>1 arrays were walked incorrectly

This commit is contained in:
David Anderson 2005-09-06 20:36:02 +00:00
parent bece1e6d0c
commit 5705e69abb

View File

@ -450,9 +450,14 @@ SC_FUNC stringlist *insert_dbgsymbol(symbol *sym)
#endif #endif
if (sym->ident==iARRAY || sym->ident==iREFARRAY) { if (sym->ident==iARRAY || sym->ident==iREFARRAY) {
symbol *sub; symbol *sub;
#if !defined NDEBUG
count = sym->dim.array.level;
#endif
strcat(string," [ "); strcat(string," [ ");
for (sub=sym; sub!=NULL; sub=finddepend(sub)) { 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); sprintf(string+strlen(string),"%x:%x ",sub->x.idxtag,sub->dim.array.length);
} /* for */ } /* for */
strcat(string,"]"); strcat(string,"]");