aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1993-07-07 20:07:12 +0000
committerIan Lance Taylor <ian@airs.com>1993-07-07 20:07:12 +0000
commite154ecf4ab067beccde639b61a166eb9ebc7c0c3 (patch)
treecbc37ed22a594bfa9c9a8eb199504984c68465e9 /gas/symbols.c
parente357065c7e4fab4f2766d8b34d806f3bab419507 (diff)
downloadgdb-e154ecf4ab067beccde639b61a166eb9ebc7c0c3.zip
gdb-e154ecf4ab067beccde639b61a166eb9ebc7c0c3.tar.gz
gdb-e154ecf4ab067beccde639b61a166eb9ebc7c0c3.tar.bz2
* symbols.c (fb_label_instance, fb_label_instance_inc): Don't dump
core just because somebody uses a label before it is defined.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index ade2aa5..e39e50c 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -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;
}
/*