This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[ecj] Fix an ICE with annotations


Fixes a SEGV if the set is 0-length.

Andrew.


2006-12-04  Andrew Haley  <aph@redhat.com>

	* jcf-parse.c (rewrite_reflection_indexes): Don't do anything if
	there's no map.

Index: jcf-parse.c
===================================================================
--- jcf-parse.c	(revision 119120)
+++ jcf-parse.c	(working copy)
@@ -765,10 +765,14 @@
   VEC(int, heap) *map = arg;
   unsigned char *data = TYPE_REFLECTION_DATA (current_class);
 
-  EXECUTE_IF_SET_IN_BITMAP (field_offsets, 0, offset, bi)
+  if (map)
     {
-      uint16 index = annotation_read_short (data + offset);
-      annotation_rewrite_short (VEC_index (int, map, index), data + offset);
+      EXECUTE_IF_SET_IN_BITMAP (field_offsets, 0, offset, bi)
+	{
+	  uint16 index = annotation_read_short (data + offset);
+	  annotation_rewrite_short 
+	    (VEC_index (int, map, index), data + offset);
+	}
     }
 }
 


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