src/share/vm/classfile/verifier.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/classfile/verifier.cpp	Fri Mar 20 13:28:27 2015
--- new/src/share/vm/classfile/verifier.cpp	Fri Mar 20 13:28:25 2015

*** 655,664 **** --- 655,665 ---- stackmap_index, bci, &current_frame, &stackmap_table, no_control_flow, CHECK_VERIFY(this)); bool this_uninit = false; // Set to true when invokespecial <init> initialized 'this' + bool verified_exc_handlers = false; // Merge with the next instruction { u2 index; int target;
*** 686,695 **** --- 687,708 ---- verify_error(ErrorContext::bad_code(bci), "Bad wide instruction"); return; } } + // Look for possible jump target in exception handlers and see if it + // matches current_frame. Do this check here for astore*, dstore*, + // fstore*, istore*, and lstore* opcodes because they can change the type + // state by adding a local. JVM Spec says that the incoming type state + // should be used for this check. So, do the check here before a possible + // local is added to the type state. + if (Bytecodes::is_store_into_local(opcode) && bci >= ex_min && bci < ex_max) { + verify_exception_handler_targets( + bci, this_uninit, &current_frame, &stackmap_table, CHECK_VERIFY(this)); + verified_exc_handlers = true; + } + switch (opcode) { case Bytecodes::_nop : no_control_flow = false; break; case Bytecodes::_aconst_null : current_frame.push_stack(
*** 1667,1679 **** --- 1680,1696 ---- no_control_flow = false; return; } // end switch } // end Merge with the next instruction ! // Look for possible jump target in exception handlers and see if it matches // matches current_frame if (bci >= ex_min && bci < ex_max) { + // current_frame. Don't do this check if it has already been done (for + // ([a,d,f,i,l]store* opcodes). This check cannot be done earlier because + // opcodes, such as invokespecial, may set the this_uninit flag. + assert(!(verified_exc_handlers && this_uninit), + "Exception handler targets got verified before this_uninit got set"); + if (!verified_exc_handlers && bci >= ex_min && bci < ex_max) { verify_exception_handler_targets( bci, this_uninit, &current_frame, &stackmap_table, CHECK_VERIFY(this)); } } // end while

src/share/vm/classfile/verifier.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File