8025238: nsk/jvmti/scenarios/bcinstr/BI04/bi04t002 crashed with SIGSEGV

Redefined class in stack trace may not be found by method_idnum so handle null.

Reviewed-by: sla, dcubed, sspitsyn
This commit is contained in:
Coleen Phillimore 2013-10-03 18:53:27 -04:00
parent 13b13b1aed
commit b08778e139
2 changed files with 21 additions and 4 deletions

View file

@ -2931,7 +2931,8 @@ void VM_RedefineClasses::check_methods_and_mark_as_obsolete(
old_method->set_is_obsolete();
obsolete_count++;
// obsolete methods need a unique idnum
// obsolete methods need a unique idnum so they become new entries in
// the jmethodID cache in InstanceKlass
u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum();
if (num != ConstMethod::UNSET_IDNUM) {
old_method->set_method_idnum(num);