Fix previous fix
This commit is contained in:
parent
85f849ba08
commit
3594c6170d
@ -564,7 +564,7 @@ SC_FUNC symbol *finddepend(const symbol *parent);
|
|||||||
SC_FUNC symbol *addsym(const char *name,cell addr,int ident,int vclass,int tag,
|
SC_FUNC symbol *addsym(const char *name,cell addr,int ident,int vclass,int tag,
|
||||||
int usage);
|
int usage);
|
||||||
SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int tag,
|
SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int tag,
|
||||||
int dim[],int numdim,int idxtag[],int nestlevel);
|
int dim[],int numdim,int idxtag[],int compound);
|
||||||
SC_FUNC int getlabel(void);
|
SC_FUNC int getlabel(void);
|
||||||
SC_FUNC char *itoh(ucell val);
|
SC_FUNC char *itoh(ucell val);
|
||||||
|
|
||||||
|
@ -2092,7 +2092,7 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
|
|||||||
} /* if */
|
} /* if */
|
||||||
litidx=0;
|
litidx=0;
|
||||||
if (sym==NULL) { /* define only if not yet defined */
|
if (sym==NULL) { /* define only if not yet defined */
|
||||||
sym=addvariable(name,address,ident,sGLOBAL,tag,dim,numdim,idxtag,nestlevel);
|
sym=addvariable(name,address,ident,sGLOBAL,tag,dim,numdim,idxtag,0);
|
||||||
if (sc_curstates>0)
|
if (sc_curstates>0)
|
||||||
attachstatelist(sym,sc_curstates);
|
attachstatelist(sym,sc_curstates);
|
||||||
} else { /* if declared but not yet defined, adjust the variable's address */
|
} else { /* if declared but not yet defined, adjust the variable's address */
|
||||||
@ -3454,7 +3454,7 @@ static void funcstub(int fnative)
|
|||||||
/* attach the array to the function symbol */
|
/* attach the array to the function symbol */
|
||||||
if (numdim>0) {
|
if (numdim>0) {
|
||||||
assert(sym!=NULL);
|
assert(sym!=NULL);
|
||||||
sub=addvariable(symbolname,0,iARRAY,sGLOBAL,tag,dim,numdim,idxtag,nestlevel);
|
sub=addvariable(symbolname,0,iARRAY,sGLOBAL,tag,dim,numdim,idxtag,0);
|
||||||
sub->parent=sym;
|
sub->parent=sym;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
@ -4016,8 +4016,7 @@ static void doarg(char *name,int ident,int offset,int tags[],int numtags,
|
|||||||
/* add details of type and address */
|
/* add details of type and address */
|
||||||
assert(numtags>0);
|
assert(numtags>0);
|
||||||
argsym=addvariable(name,offset,ident,sLOCAL,tags[0],
|
argsym=addvariable(name,offset,ident,sLOCAL,tags[0],
|
||||||
arg->dim,arg->numdim,arg->idxtag,nestlevel);
|
arg->dim,arg->numdim,arg->idxtag,0);
|
||||||
argsym->compound=0;
|
|
||||||
if (ident==iREFERENCE)
|
if (ident==iREFERENCE)
|
||||||
argsym->usage|=uREAD; /* because references are passed back */
|
argsym->usage|=uREAD; /* because references are passed back */
|
||||||
if (fpublic)
|
if (fpublic)
|
||||||
@ -5786,7 +5785,7 @@ static void doreturn(void)
|
|||||||
for (argcount=0; curfunc->dim.arglist[argcount].ident!=0; argcount++)
|
for (argcount=0; curfunc->dim.arglist[argcount].ident!=0; argcount++)
|
||||||
/* nothing */;
|
/* nothing */;
|
||||||
sub=addvariable(curfunc->name,(argcount+3)*sizeof(cell),iREFARRAY,sGLOBAL,
|
sub=addvariable(curfunc->name,(argcount+3)*sizeof(cell),iREFARRAY,sGLOBAL,
|
||||||
curfunc->tag,dim,numdim,idxtag,nestlevel);
|
curfunc->tag,dim,numdim,idxtag,0);
|
||||||
sub->parent=curfunc;
|
sub->parent=curfunc;
|
||||||
} /* if */
|
} /* if */
|
||||||
/* get the hidden parameter, copy the array (the array is on the heap;
|
/* get the hidden parameter, copy the array (the array is on the heap;
|
||||||
|
@ -2991,7 +2991,7 @@ SC_FUNC symbol *addsym(const char *name,cell addr,int ident,int vclass,int tag,i
|
|||||||
}
|
}
|
||||||
|
|
||||||
SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int tag,
|
SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int tag,
|
||||||
int dim[],int numdim,int idxtag[],int nestlevel)
|
int dim[],int numdim,int idxtag[],int compound)
|
||||||
{
|
{
|
||||||
symbol *sym;
|
symbol *sym;
|
||||||
|
|
||||||
@ -3016,13 +3016,18 @@ SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int
|
|||||||
top->dim.array.level=(short)(numdim-level-1);
|
top->dim.array.level=(short)(numdim-level-1);
|
||||||
top->x.tags.index=idxtag[level];
|
top->x.tags.index=idxtag[level];
|
||||||
top->parent=parent;
|
top->parent=parent;
|
||||||
top->compound=nestlevel; /* for multiple declaration/shadowing check */
|
if (vclass==sLOCAL || vclass==sSTATIC) {
|
||||||
|
top->compound=compound; /* for multiple declaration/shadowing check */
|
||||||
|
} /* if */
|
||||||
parent=top;
|
parent=top;
|
||||||
if (level==0)
|
if (level==0)
|
||||||
sym=top;
|
sym=top;
|
||||||
} /* for */
|
} /* for */
|
||||||
} else {
|
} else {
|
||||||
sym=addsym(name,addr,ident,vclass,tag,uDEFINE);
|
sym=addsym(name,addr,ident,vclass,tag,uDEFINE);
|
||||||
|
if (vclass==sLOCAL || vclass==sSTATIC) {
|
||||||
|
sym->compound=compound; /* for multiple declaration/shadowing check */
|
||||||
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
return sym;
|
return sym;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user