Lindseys fix to a bug with nested procedures
authorceriel <none@none>
Mon, 9 Mar 1987 10:15:51 +0000 (10:15 +0000)
committerceriel <none@none>
Mon, 9 Mar 1987 10:15:51 +0000 (10:15 +0000)
util/opt/backward.c
util/opt/lookup.h
util/opt/process.c

index ab842f8..eca9f9e 100644 (file)
@@ -32,10 +32,12 @@ static char rcsid[] = "$Header$";
  * Author: Hans van Staveren
  */
 
-#define local(x)       if (((x)->s_flags&SYMKNOWN) == 0)\
-                               x->s_flags &= ~ SYMGLOBAL
-#define global(x)      if(((x)->s_flags&SYMKNOWN) == 0)\
-                               x->s_flags |= SYMGLOBAL
+#define local(x)       ((((x)->s_flags&SYMKNOWN) == 0 && \
+                         ((x)->s_flags &= ~ SYMGLOBAL)),\
+                        (x)->s_flags |= SYMSEEN)
+#define global(x)      ((((x)->s_flags&SYMKNOWN) == 0 && \
+                         ((x)->s_flags |= SYMGLOBAL)), \
+                        (x)->s_flags |= SYMSEEN)
 
 #define DTYPHOL        1
 #define DTYPBSS 2
index 0d36e3b..9ec0a7e 100644 (file)
@@ -17,6 +17,7 @@ struct sym {
 #define SYMKNOWN       000004
 #define SYMOUT         000010
 #define SYMDEF         000020
+#define SYMSEEN                000040
 
 #define NSYMHASH       127
 extern sym_p symhash[NSYMHASH],symlookup();
index 0c763d8..d6c6068 100644 (file)
@@ -93,7 +93,8 @@ symknown() {
 
        for (spp = symhash; spp < &symhash[NSYMHASH]; spp++)
                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() {