From: Tom Tromey Date: Fri, 24 Jun 2005 22:09:15 +0000 (+0000) Subject: verify-impl.c (verify_instructions_0): Correctly handle situation where PC falls... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aca02b7e0012d382259660d8d44917e30a24dfec;p=gcc.git 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 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4c967594797..bfc0df12a99 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2005-06-24 Tom Tromey + + * verify-impl.c (verify_instructions_0): Correctly handle + situation where PC falls off end. + 2005-06-23 Bryce McKinlay PR java/20697 diff --git a/gcc/java/verify-impl.c b/gcc/java/verify-impl.c index db6078e9c97..f7876387481 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 diff --git a/libjava/ChangeLog b/libjava/ChangeLog index af57bb6a271..bcc1eabc343 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2005-06-24 Tom Tromey + + * verify.cc (verify_instructions_0): Correctly handle situation + where PC falls off end. + 2005-06-24 Tom Tromey * interpret.cc (compile): Handle case where table entry is diff --git a/libjava/verify.cc b/libjava/verify.cc index a47571bb809..167d74cf8f6 100644 --- a/libjava/verify.cc +++ b/libjava/verify.cc @@ -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