changeset 2984:76c46d4d4ad0 icedtea-2.1.5

8001307: Modify ACC_SUPER behavior Summary: Disallow non-virtual calls even when ACC_SUPER is absent. Reviewed-by: kvn, acorn
author andrew
date Tue, 05 Feb 2013 08:44:37 +0000
parents 3f345e5f65eb
children 32569b4d36f4
files src/share/vm/interpreter/linkResolver.cpp src/share/vm/runtime/globals.hpp
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/interpreter/linkResolver.cpp	Mon Jan 14 22:22:14 2013 +0000
+++ b/src/share/vm/interpreter/linkResolver.cpp	Tue Feb 05 08:44:37 2013 +0000
@@ -709,7 +709,7 @@
 
     if (check_access &&
         // a) check if ACC_SUPER flag is set for the current class
-        current_klass->is_super() &&
+        (current_klass->is_super() || !AllowNonVirtualCalls) &&
         // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!)
         current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() &&
         // c) check if the method is not <init>
--- a/src/share/vm/runtime/globals.hpp	Mon Jan 14 22:22:14 2013 +0000
+++ b/src/share/vm/runtime/globals.hpp	Tue Feb 05 08:44:37 2013 +0000
@@ -3837,7 +3837,10 @@
   product(bool, UseVMInterruptibleIO, false,                                \
           "(Unstable, Solaris-specific) Thread interrupt before or with "   \
           "EINTR for I/O operations results in OS_INTRPT. The default value"\
-          " of this flag is true for JDK 6 and earliers")
+          " of this flag is true for JDK 6 and earlier")                    \
+                                                                            \
+  product(bool, AllowNonVirtualCalls, false,                                \
+         "Obey the ACC_SUPER flag and allow invokenonvirtual calls")
 
 /*
  *  Macros for factoring of globals