aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/verify-impl.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-06-24 22:09:15 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-06-24 22:09:15 +0000
commitaca02b7e0012d382259660d8d44917e30a24dfec (patch)
treedc3cacf7c6d08a5e1aadc432281d4ad24526b9b2 /gcc/java/verify-impl.c
parent6a05987083f4bb8812017baa0e3a134d21a4095e (diff)
downloadgcc-aca02b7e0012d382259660d8d44917e30a24dfec.zip
gcc-aca02b7e0012d382259660d8d44917e30a24dfec.tar.gz
gcc-aca02b7e0012d382259660d8d44917e30a24dfec.tar.bz2
verify-impl.c (verify_instructions_0): Correctly handle situation where PC falls off end.
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
Diffstat (limited to 'gcc/java/verify-impl.c')
-rw-r--r--gcc/java/verify-impl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c
index db6078e..f787638 100644
--- a/gcc/java/verify-impl.c
+++ b/gcc/java/verify-impl.c
@@ -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