Fix compiler bug with multidimensional array variable release (bug 6100, r=fyren).
--HG-- extra : rebase_source : 3f3c366fd8c47268ecd0df5907b68d3c879a5e60
This commit is contained in:
parent
e9b4a6e96c
commit
29ff05bd62
@ -142,6 +142,8 @@ class SMConfig(object):
|
|||||||
'-Wno-uninitialized',
|
'-Wno-uninitialized',
|
||||||
'-Wno-unused',
|
'-Wno-unused',
|
||||||
'-Wno-switch',
|
'-Wno-switch',
|
||||||
|
'-Wno-format',
|
||||||
|
'-Wno-format-security',
|
||||||
'-msse',
|
'-msse',
|
||||||
'-m32',
|
'-m32',
|
||||||
]
|
]
|
||||||
|
@ -538,6 +538,7 @@ SC_FUNC symbol *add_constant(char *name,cell val,int vclass,int tag);
|
|||||||
SC_FUNC void exporttag(int tag);
|
SC_FUNC void exporttag(int tag);
|
||||||
SC_FUNC void sc_attachdocumentation(symbol *sym);
|
SC_FUNC void sc_attachdocumentation(symbol *sym);
|
||||||
SC_FUNC constvalue *find_tag_byval(int tag);
|
SC_FUNC constvalue *find_tag_byval(int tag);
|
||||||
|
SC_FUNC int get_actual_compound(symbol *sym);
|
||||||
|
|
||||||
/* function prototypes in SC2.C */
|
/* function prototypes in SC2.C */
|
||||||
#define PUSHSTK_P(v) { stkitem s_; s_.pv=(v); pushstk(s_); }
|
#define PUSHSTK_P(v) { stkitem s_; s_.pv=(v); pushstk(s_); }
|
||||||
|
@ -5417,7 +5417,7 @@ static void destructsymbols(symbol *root,int level)
|
|||||||
cell offset=0;
|
cell offset=0;
|
||||||
int savepri=FALSE;
|
int savepri=FALSE;
|
||||||
symbol *sym=root->next;
|
symbol *sym=root->next;
|
||||||
while (sym!=NULL && sym->compound>=level) {
|
while (sym!=NULL && get_actual_compound(sym)>=level) {
|
||||||
if (sym->ident==iVARIABLE || sym->ident==iARRAY) {
|
if (sym->ident==iVARIABLE || sym->ident==iARRAY) {
|
||||||
char symbolname[16];
|
char symbolname[16];
|
||||||
symbol *opsym;
|
symbol *opsym;
|
||||||
|
@ -2461,6 +2461,16 @@ SC_FUNC void delete_symbol(symbol *root,symbol *sym)
|
|||||||
free_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)
|
SC_FUNC void delete_symbols(symbol *root,int level,int delete_labels,int delete_functions)
|
||||||
{
|
{
|
||||||
symbol *origRoot=root;
|
symbol *origRoot=root;
|
||||||
@ -2472,7 +2482,7 @@ SC_FUNC void delete_symbols(symbol *root,int level,int delete_labels,int delete_
|
|||||||
* specified nesting level */
|
* specified nesting level */
|
||||||
while (root->next!=NULL) {
|
while (root->next!=NULL) {
|
||||||
sym=root->next;
|
sym=root->next;
|
||||||
if (sym->compound<level)
|
if (get_actual_compound(sym)<level)
|
||||||
break;
|
break;
|
||||||
switch (sym->ident) {
|
switch (sym->ident) {
|
||||||
case iLABEL:
|
case iLABEL:
|
||||||
|
Loading…
Reference in New Issue
Block a user