Compiler: Fix issue with multidimensional array variable release.

Imported from SM: https://bugs.alliedmods.net/show_bug.cgi?id=6100.
This commit is contained in:
Arkshine
2014-08-13 15:38:50 +02:00
parent 6978e2dc4c
commit 325a746d90
4 changed files with 15 additions and 2 deletions

View File

@ -2417,6 +2417,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 *sym,*parent_sym;
@ -2427,7 +2437,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: