verify-impl.c (verify_instructions_0): Correctly handle situation where PC falls...
authorTom Tromey <tromey@redhat.com>
Fri, 24 Jun 2005 22:09:15 +0000 (22:09 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 24 Jun 2005 22:09:15 +0000 (22:09 +0000)
gcc/java/:
* verify-impl.c (verify_instructions_0): Correctly handle
situation where PC falls off end.
libjava/:
* verify.cc (verify_instructions_0): Correctly handle situation
where PC falls off end.

From-SVN: r101299

gcc/java/ChangeLog
gcc/java/verify-impl.c
libjava/ChangeLog
libjava/verify.cc

index 4c967594797a399aee6675cea5f8b03cb9245dcf..bfc0df12a993cfaba6dffbadde8577c3464e625d 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-24  Tom Tromey  <tromey@redhat.com>
+
+       * verify-impl.c (verify_instructions_0): Correctly handle
+       situation where PC falls off end.
+
 2005-06-23  Bryce McKinlay  <mckinlay@redhat.com>
 
        PR java/20697
index db6078e9c976f72138ddbc635d3355108e8915d0..f78763874817943830fb12cd04eb6174a7b7087a 100644 (file)
@@ -2251,10 +2251,12 @@ verify_instructions_0 (void)
       else
        {
          /* We only have to do this checking in the situation where
-            control flow falls through from the previous
-            instruction.  Otherwise merging is done at the time we
-            push the branch.  */
-         if (vfr->states[vfr->PC] != NULL)
+            control flow falls through from the previous instruction.
+            Otherwise merging is done at the time we push the branch.
+            Note that we'll catch the off-the-end problem just
+            below.  */
+         if (vfr->PC < vfr->current_method->code_length
+             && vfr->states[vfr->PC] != NULL)
            {
              /* We've already visited this instruction.  So merge
                 the states together.  It is simplest, but not most
index af57bb6a271c8170a97edca2d8b152a4199b7366..bcc1eabc343af3556307f1986bf12ad11384f408 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-24  Tom Tromey  <tromey@redhat.com>
+
+       * verify.cc (verify_instructions_0): Correctly handle situation
+       where PC falls off end.
+
 2005-06-24  Tom Tromey  <tromey@redhat.com>
 
        * interpret.cc (compile): Handle case where table entry is
index a47571bb809e9c8e5073473f4d1537250aa874f4..167d74cf8f6390ccfd1db36b8b8d98364727e350 100644 (file)
@@ -2198,8 +2198,9 @@ private:
            // We only have to do this checking in the situation where
            // control flow falls through from the previous
            // instruction.  Otherwise merging is done at the time we
-           // push the branch.
-           if (states[PC] != NULL)
+           // push the branch.  Note that we'll catch the
+           // off-the-end problem just below.
+           if (PC < current_method->code_length && states[PC] != NULL)
              {
                // We've already visited this instruction.  So merge
                // the states together.  It is simplest, but not most