This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[ecj] Fix an ICE with annotations
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Mon, 4 Dec 2006 19:17:52 +0000
- Subject: [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);
+ }
}
}