This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]