silly fb label numbers

Alan Modra amodra@gmail.com
Wed Aug 21 05:54:00 GMT 2013


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



More information about the Binutils mailing list