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 13 13:30:07 2015
--- new/src/share/vm/classfile/verifier.cpp	Fri Mar 13 13:30:06 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,707 ---- 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* opcodes because + // they can both reference the exception object in a handler and change + // the type state. JVM Spec says that the incoming type state should be + // used for this check. + if (Bytecodes::is_astore(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 **** --- 1679,1695 ---- 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 + // astore* 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