changeset 9324:8e4288c4127d

8135208: VM permits illegal <clinit> access_flags, versions 51-52 Summary: Check access flags for <clinit> methods that are not class init methods. Reviewed-by: kamg, gtriantafill
author hseigel
date Tue, 22 Sep 2015 09:48:19 -0400
parents 111681c88c9a
children 9cd2f42c84c0
files src/share/vm/classfile/classFileParser.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp	Fri Sep 11 15:31:03 2015 -0400
+++ b/src/share/vm/classfile/classFileParser.cpp	Tue Sep 22 09:48:19 2015 -0400
@@ -1989,6 +1989,10 @@
       flags = JVM_ACC_STATIC;
     } else if ((flags & JVM_ACC_STATIC) == JVM_ACC_STATIC) {
       flags &= JVM_ACC_STATIC | JVM_ACC_STRICT;
+    } else {
+      // As of major_version 51, a method named <clinit> without ACC_STATIC is
+      // just another method. So, do a normal method modifer check.
+      verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));
     }
   } else {
     verify_legal_method_modifiers(flags, is_interface, name, CHECK_(nullHandle));