Lindseys fix to a bug with nested procedures

This commit is contained in:
ceriel 1987-03-09 10:15:51 +00:00
parent 539c95237e
commit fa0f6cd0c6
3 changed files with 9 additions and 5 deletions

View file

@ -32,10 +32,12 @@ static char rcsid[] = "$Header$";
* Author: Hans van Staveren * Author: Hans van Staveren
*/ */
#define local(x) if (((x)->s_flags&SYMKNOWN) == 0)\ #define local(x) ((((x)->s_flags&SYMKNOWN) == 0 && \
x->s_flags &= ~ SYMGLOBAL ((x)->s_flags &= ~ SYMGLOBAL)),\
#define global(x) if(((x)->s_flags&SYMKNOWN) == 0)\ (x)->s_flags |= SYMSEEN)
x->s_flags |= SYMGLOBAL #define global(x) ((((x)->s_flags&SYMKNOWN) == 0 && \
((x)->s_flags |= SYMGLOBAL)), \
(x)->s_flags |= SYMSEEN)
#define DTYPHOL 1 #define DTYPHOL 1
#define DTYPBSS 2 #define DTYPBSS 2

View file

@ -17,6 +17,7 @@ struct sym {
#define SYMKNOWN 000004 #define SYMKNOWN 000004
#define SYMOUT 000010 #define SYMOUT 000010
#define SYMDEF 000020 #define SYMDEF 000020
#define SYMSEEN 000040
#define NSYMHASH 127 #define NSYMHASH 127
extern sym_p symhash[NSYMHASH],symlookup(); extern sym_p symhash[NSYMHASH],symlookup();

View file

@ -93,7 +93,8 @@ symknown() {
for (spp = symhash; spp < &symhash[NSYMHASH]; spp++) for (spp = symhash; spp < &symhash[NSYMHASH]; spp++)
for (sp = *spp; sp != (sym_p) 0; sp = sp->s_next) for (sp = *spp; sp != (sym_p) 0; sp = sp->s_next)
sp->s_flags |= SYMKNOWN; if (sp->s_flags & SYMSEEN)
sp->s_flags |= SYMKNOWN;
} }
cleanlocals() { cleanlocals() {