* symbols.c (fb_label_instance, fb_label_instance_inc): Don't dump
authorIan Lance Taylor <ian@airs.com>
Wed, 7 Jul 1993 20:07:12 +0000 (20:07 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 7 Jul 1993 20:07:12 +0000 (20:07 +0000)
core just because somebody uses a label before it is defined.

gas/ChangeLog
gas/symbols.c

index d8eb36afc8b8683ea73e48e243f5546f9534e041..be540ea775b9f85366dee391704b7790d00b6bcd 100644 (file)
@@ -1,5 +1,8 @@
 Wed Jul  7 10:21:24 1993  Ian Lance Taylor  (ian@cygnus.com)
 
+       * symbols.c (fb_label_instance, fb_label_instance_inc): Don't dump
+       core just because somebody uses a label before it is defined.
+
        * config/mips-opcode.h: Moved to opcode/mips.h.
        * config/tc-mips.c: Include opcode/mips.h rather than
        mips-opcode.h.
index ade2aa55e6bafffe9c3bd092fe016649f9121005..e39e50c92f941bf5db972f3c9525305268eb7d3f 100644 (file)
@@ -771,14 +771,18 @@ fb_label_instance_inc (label)
       return;
     }
 
-  for (i = fb_labels + FB_LABEL_SPECIAL; i < fb_labels + fb_label_count; ++i)
+  if (fb_labels != NULL)
     {
-      if (*i == label)
+      for (i = fb_labels + FB_LABEL_SPECIAL;
+          i < fb_labels + fb_label_count; ++i)
        {
-         ++fb_label_instances[i - fb_labels];
-         return;
-       }                       /* if we find it */
-    }                          /* for each existing label */
+         if (*i == label)
+           {
+             ++fb_label_instances[i - fb_labels];
+             return;
+           }                   /* if we find it */
+       }                       /* for each existing label */
+    }
 
   /* if we get to here, we don't have label listed yet. */
 
@@ -816,16 +820,21 @@ fb_label_instance (label)
       return (fb_low_counter[label]);
     }
 
-  for (i = fb_labels + FB_LABEL_SPECIAL; i < fb_labels + fb_label_count; ++i)
+  if (fb_labels != NULL)
     {
-      if (*i == label)
+      for (i = fb_labels + FB_LABEL_SPECIAL;
+          i < fb_labels + fb_label_count; ++i)
        {
-         return (fb_label_instances[i - fb_labels]);
-       }                       /* if we find it */
-    }                          /* for each existing label */
+         if (*i == label)
+           {
+             return (fb_label_instances[i - fb_labels]);
+           }                   /* if we find it */
+       }                       /* for each existing label */
+    }
 
-  /* NOTREACHED */
-  abort ();
+  /* We didn't find the label, so this must be a reference to the
+     first instance.  */
+  return 0;
 }
 
 /*