src/share/vm/classfile/verifier.cpp

changeset 8525
0095e54dcaa1
parent 7666
6b65121b3258
child 8570
e4525db27263
     1.1 --- a/src/share/vm/classfile/verifier.cpp	Tue May 31 09:24:08 2016 -0700
     1.2 +++ b/src/share/vm/classfile/verifier.cpp	Wed May 11 12:03:46 2016 -0400
     1.3 @@ -2323,9 +2323,17 @@
     1.4        case Bytecodes::_ifnonnull:
     1.5          target = bcs.dest();
     1.6          if (visited_branches->contains(bci)) {
     1.7 -          if (bci_stack->is_empty()) return true;
     1.8 -          // Pop a bytecode starting offset and scan from there.
     1.9 -          bcs.set_start(bci_stack->pop());
    1.10 +          if (bci_stack->is_empty()) {
    1.11 +            if (handler_stack->is_empty()) {
    1.12 +              return true;
    1.13 +            } else {
    1.14 +              // Parse the catch handlers for try blocks containing athrow.
    1.15 +              bcs.set_start(handler_stack->pop());
    1.16 +            }
    1.17 +          } else {
    1.18 +            // Pop a bytecode starting offset and scan from there.
    1.19 +            bcs.set_start(bci_stack->pop());
    1.20 +          }
    1.21          } else {
    1.22            if (target > bci) { // forward branch
    1.23              if (target >= code_length) return false;
    1.24 @@ -2348,9 +2356,17 @@
    1.25        case Bytecodes::_goto_w:
    1.26          target = (opcode == Bytecodes::_goto ? bcs.dest() : bcs.dest_w());
    1.27          if (visited_branches->contains(bci)) {
    1.28 -          if (bci_stack->is_empty()) return true;
    1.29 -          // Been here before, pop new starting offset from stack.
    1.30 -          bcs.set_start(bci_stack->pop());
    1.31 +          if (bci_stack->is_empty()) {
    1.32 +            if (handler_stack->is_empty()) {
    1.33 +              return true;
    1.34 +            } else {
    1.35 +              // Parse the catch handlers for try blocks containing athrow.
    1.36 +              bcs.set_start(handler_stack->pop());
    1.37 +            }
    1.38 +          } else {
    1.39 +            // Been here before, pop new starting offset from stack.
    1.40 +            bcs.set_start(bci_stack->pop());
    1.41 +          }
    1.42          } else {
    1.43            if (target >= code_length) return false;
    1.44            // Continue scanning from the target onward.

mercurial