Fix compiler bug with multidimensional array variable release (bug 6100, r=fyren).

--HG--
extra : rebase_source : 3f3c366fd8c47268ecd0df5907b68d3c879a5e60
This commit is contained in:
David Anderson
2014-05-09 23:17:14 -04:00
parent e9b4a6e96c
commit 29ff05bd62
4 changed files with 15 additions and 2 deletions
+11 -1
View File
@@ -2461,6 +2461,16 @@ SC_FUNC void delete_symbol(symbol *root,symbol *sym)
free_symbol(sym);
}
SC_FUNC int get_actual_compound(symbol *sym)
{
if (sym->ident == iARRAY || sym->ident == iREFARRAY) {
while (sym->parent)
sym = sym->parent;
}
return sym->compound;
}
SC_FUNC void delete_symbols(symbol *root,int level,int delete_labels,int delete_functions)
{
symbol *origRoot=root;
@@ -2472,7 +2482,7 @@ SC_FUNC void delete_symbols(symbol *root,int level,int delete_labels,int delete_
* specified nesting level */
while (root->next!=NULL) {
sym=root->next;
if (sym->compound<level)
if (get_actual_compound(sym)<level)
break;
switch (sym->ident) {
case iLABEL: