comparison src/share/vm/classfile/verifier.cpp @ 6155:d558e01a72c0

7160757: Problem with hotspot/runtime_classfile Summary: Allow only current and super invokespecials of <init> Reviewed-by: never, coleenp, dcubed
author kamg
date Thu, 03 May 2012 15:37:46 -0400
parents ed69575596ac
children 9d5f20961bc5
comparison
equal deleted inserted replaced
6153:aa07e41a9f80 6155:d558e01a72c0
1878 constantPoolHandle cp, TRAPS) { 1878 constantPoolHandle cp, TRAPS) {
1879 u2 bci = bcs->bci(); 1879 u2 bci = bcs->bci();
1880 VerificationType type = current_frame->pop_stack( 1880 VerificationType type = current_frame->pop_stack(
1881 VerificationType::reference_check(), CHECK_VERIFY(this)); 1881 VerificationType::reference_check(), CHECK_VERIFY(this));
1882 if (type == VerificationType::uninitialized_this_type()) { 1882 if (type == VerificationType::uninitialized_this_type()) {
1883 // The method must be an <init> method of either this class, or one of its 1883 // The method must be an <init> method of this class or its superclass
1884 // superclasses 1884 klassOop superk = current_class()->super();
1885 if (ref_class_type.name() != current_class()->name() && 1885 if (ref_class_type.name() != current_class()->name() &&
1886 !name_in_supers(ref_class_type.name(), current_class())) { 1886 ref_class_type.name() != superk->klass_part()->name()) {
1887 verify_error(bci, "Bad <init> method call"); 1887 verify_error(bci, "Bad <init> method call");
1888 return; 1888 return;
1889 } 1889 }
1890 current_frame->initialize_object(type, current_type()); 1890 current_frame->initialize_object(type, current_type());
1891 *this_uninit = true; 1891 *this_uninit = true;