]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
boehm.c (mark_reference_fields): Move misaligned pointer check
authorRoman Zippel <zippel@linux-m68k.org>
Thu, 6 Sep 2007 23:00:01 +0000 (23:00 +0000)
committerRoman Zippel <zippel@gcc.gnu.org>
Thu, 6 Sep 2007 23:00:01 +0000 (23:00 +0000)
after JREFERENCE_TYPE_P test

From-SVN: r128208

gcc/java/ChangeLog
gcc/java/boehm.c

index 35722715a6bd9eac80807b5270fbb0bc579294cf..9b637bc24d2f7edaee1ce94fa89e369daec55dce 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-07  Roman Zippel  <zippel@linux-m68k.org>
+
+       boehm.c (mark_reference_fields): Move misaligned pointer check
+       after JREFERENCE_TYPE_P test
+
 2007-09-06  Roman Zippel  <zippel@linux-m68k.org>
 
        * boehm.c (mark_reference_fields): Don't use bitmap as gc_descr
index c44c620095163f30121c5bbbcdf6c1370cebc1b4..5c65c8bb0cc392c5fe57da8f82692ef7574a9e34 100644 (file)
@@ -98,13 +98,6 @@ mark_reference_fields (tree field,
       offset = int_byte_position (field);
       size_bytes = int_size_in_bytes (TREE_TYPE (field));
 
-      if (offset % (POINTER_SIZE / BITS_PER_UNIT))
-       {
-         *all_bits_set = -1;
-         *pointer_after_end = 1;
-         break;
-       }
-
       if (JREFERENCE_TYPE_P (TREE_TYPE (field))
          /* An `object' of type gnu.gcj.RawData is actually non-Java
             data.  */
@@ -118,6 +111,13 @@ mark_reference_fields (tree field,
             we already covered, then we are doomed.  */
          gcc_assert (offset > *last_view_index);
 
+         if (offset % (POINTER_SIZE / BITS_PER_UNIT))
+           {
+             *all_bits_set = -1;
+             *pointer_after_end = 1;
+             break;
+           }
+
          count = offset * BITS_PER_UNIT / POINTER_SIZE;
          size_words = size_bytes * BITS_PER_UNIT / POINTER_SIZE;