This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
silly fb label numbers
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 21 Aug 2013 15:24:42 +0930
- Subject: silly fb label numbers
Someone was trying really silly fb labels like 8000000000000000f a
while ago, and found gas misbehaved.
* symbols.c (fb_label_instance_inc, fb_label_instance): Properly
range check label number for use with fb_low_counter array.
Index: gas/symbols.c
===================================================================
RCS file: /cvs/src/src/gas/symbols.c,v
retrieving revision 1.118
diff -u -p -r1.118 symbols.c
--- gas/symbols.c 10 Jan 2013 19:51:54 -0000 1.118
+++ gas/symbols.c 21 Aug 2013 05:42:21 -0000
@@ -1749,7 +1749,7 @@ fb_label_instance_inc (long label)
{
long *i;
- if (label < FB_LABEL_SPECIAL)
+ if ((unsigned long) label < FB_LABEL_SPECIAL)
{
++fb_low_counter[label];
return;
@@ -1797,7 +1797,7 @@ fb_label_instance (long label)
{
long *i;
- if (label < FB_LABEL_SPECIAL)
+ if ((unsigned long) label < FB_LABEL_SPECIAL)
{
return (fb_low_counter[label]);
}
--
Alan Modra
Australia Development Lab, IBM