comparison src/share/vm/oops/instanceKlass.cpp @ 13401:22eaa15b7960

8026065: InterfaceMethodref for invokespecial must name a direct superinterface Summary: Add verification to check that invokespecial of an InterfaceMethodref names a method in a direct superinterface of the current class or interface in accordance with JSR 335, JVMS 4.9.2 Structural Constraints. Reviewed-by: acorn, hseigel, coleenp Contributed-by: lois.foltan@oracle.com
author hseigel
date Tue, 26 Nov 2013 09:52:22 -0500
parents 6e1826d5c23e
children 379f11bc04fc 9fc985481d78 3205e78d8193
comparison
equal deleted inserted replaced
13400:86e6d691f2e1 13401:22eaa15b7960
1049 } 1049 }
1050 } 1050 }
1051 return false; 1051 return false;
1052 } 1052 }
1053 1053
1054 bool InstanceKlass::is_same_or_direct_interface(Klass *k) const {
1055 // Verify direct super interface
1056 if (this == k) return true;
1057 assert(k->is_interface(), "should be an interface class");
1058 for (int i = 0; i < local_interfaces()->length(); i++) {
1059 if (local_interfaces()->at(i) == k) {
1060 return true;
1061 }
1062 }
1063 return false;
1064 }
1065
1054 objArrayOop InstanceKlass::allocate_objArray(int n, int length, TRAPS) { 1066 objArrayOop InstanceKlass::allocate_objArray(int n, int length, TRAPS) {
1055 if (length < 0) THROW_0(vmSymbols::java_lang_NegativeArraySizeException()); 1067 if (length < 0) THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
1056 if (length > arrayOopDesc::max_array_length(T_OBJECT)) { 1068 if (length > arrayOopDesc::max_array_length(T_OBJECT)) {
1057 report_java_out_of_memory("Requested array size exceeds VM limit"); 1069 report_java_out_of_memory("Requested array size exceeds VM limit");
1058 JvmtiExport::post_array_size_exhausted(); 1070 JvmtiExport::post_array_size_exhausted();