diff src/share/vm/oops/klassVtable.cpp @ 5699:9d15b81d5d1b

8016839: JSR292: AME instead of IAE when calling a method Summary: Catch missing-because-illegal case for itable entries and use an exception-throwing method instead of null. Reviewed-by: acorn, jrose, coleenp
author drchase
date Tue, 26 Nov 2013 18:16:04 -0500
parents fce21ac5968d
children 379f11bc04fc
line wrap: on
line diff
--- a/src/share/vm/oops/klassVtable.cpp	Fri Nov 22 13:42:46 2013 -0800
+++ b/src/share/vm/oops/klassVtable.cpp	Tue Nov 26 18:16:04 2013 -0500
@@ -1076,7 +1076,12 @@
       LinkResolver::lookup_instance_method_in_klasses(target, _klass, m->name(), m->signature(), CHECK);
     }
     if (target == NULL || !target->is_public() || target->is_abstract()) {
-      // Entry do not resolve. Leave it empty
+      // Entry does not resolve. Leave it empty for AbstractMethodError.
+        if (!(target == NULL) && !target->is_public()) {
+          // Stuff an IllegalAccessError throwing method in there instead.
+          itableOffsetEntry::method_entry(_klass(), method_table_offset)[m->itable_index()].
+              initialize(Universe::throw_illegal_access_error());
+        }
     } else {
       // Entry did resolve, check loader constraints before initializing
       // if checkconstraints requested