From c2c924e35ebd6bb4f4de1c76c12f9ef81dce65fd Mon Sep 17 00:00:00 2001 From: dsamersoff Date: Thu, 9 Dec 2010 17:53:22 +0300 Subject: [PATCH] 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 --- src/share/vm/oops/klassVtable.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/share/vm/oops/klassVtable.cpp b/src/share/vm/oops/klassVtable.cpp index 15933915c..c7909164b 100644 --- a/src/share/vm/oops/klassVtable.cpp +++ b/src/share/vm/oops/klassVtable.cpp @@ -518,18 +518,21 @@ bool klassVtable::is_miranda_entry_at(int i) { bool klassVtable::is_miranda(methodOop m, objArrayOop class_methods, klassOop super) { symbolOop name = m->name(); symbolOop signature = m->signature(); + if (instanceKlass::find_method(class_methods, name, signature) == NULL) { - // did not find it in the method table of the current class + // did not find it in the method table of the current class if (super == NULL) { // super doesn't exist return true; - } else { - if (instanceKlass::cast(super)->lookup_method(name, signature) == NULL) { - // super class hierarchy does not implement it - return true; - } + } + + methodOop mo = instanceKlass::cast(super)->lookup_method(name, signature); + if (mo == NULL || mo->access_flags().is_private() ) { + // super class hierarchy does not implement it or protection is different + return true; } } + return false; } -- GitLab