Mercurial > hg > truffle
comparison src/share/vm/oops/klassVtable.cpp @ 2018:642e54d1850a
6989076: JVM crashes in klassItable::initialize_itable_for_interface
Summary: hotspot should check protection attribute besides the name and signature of the method when constructing vtable.
Reviewed-by: dcubed
author | dsamersoff |
---|---|
date | Thu, 09 Dec 2010 17:53:22 +0300 |
parents | f95d63e2154a |
children | 3582bf76420e |
comparison
equal
deleted
inserted
replaced
1990:401fbd7ff77c | 2018:642e54d1850a |
---|---|
516 // check if a method is a miranda method, given a class's methods table and it's super | 516 // check if a method is a miranda method, given a class's methods table and it's super |
517 // the caller must make sure that the method belongs to an interface implemented by the class | 517 // the caller must make sure that the method belongs to an interface implemented by the class |
518 bool klassVtable::is_miranda(methodOop m, objArrayOop class_methods, klassOop super) { | 518 bool klassVtable::is_miranda(methodOop m, objArrayOop class_methods, klassOop super) { |
519 symbolOop name = m->name(); | 519 symbolOop name = m->name(); |
520 symbolOop signature = m->signature(); | 520 symbolOop signature = m->signature(); |
521 | |
521 if (instanceKlass::find_method(class_methods, name, signature) == NULL) { | 522 if (instanceKlass::find_method(class_methods, name, signature) == NULL) { |
522 // did not find it in the method table of the current class | 523 // did not find it in the method table of the current class |
523 if (super == NULL) { | 524 if (super == NULL) { |
524 // super doesn't exist | 525 // super doesn't exist |
525 return true; | 526 return true; |
526 } else { | 527 } |
527 if (instanceKlass::cast(super)->lookup_method(name, signature) == NULL) { | 528 |
528 // super class hierarchy does not implement it | 529 methodOop mo = instanceKlass::cast(super)->lookup_method(name, signature); |
529 return true; | 530 if (mo == NULL || mo->access_flags().is_private() ) { |
530 } | 531 // super class hierarchy does not implement it or protection is different |
531 } | 532 return true; |
532 } | 533 } |
534 } | |
535 | |
533 return false; | 536 return false; |
534 } | 537 } |
535 | 538 |
536 void klassVtable::add_new_mirandas_to_list(GrowableArray<methodOop>* list_of_current_mirandas, | 539 void klassVtable::add_new_mirandas_to_list(GrowableArray<methodOop>* list_of_current_mirandas, |
537 objArrayOop current_interface_methods, | 540 objArrayOop current_interface_methods, |