diff --git a/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c b/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c index 5781ffe2494..6d43d9baa90 100644 --- a/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c +++ b/jdk/src/share/demo/jvmti/java_crw_demo/java_crw_demo.c @@ -2227,7 +2227,8 @@ inject_class(struct CrwClassImage *ci, CrwCpoolIndex this_class; CrwCpoolIndex super_class; unsigned magic; - unsigned classfileVersion; + unsigned classfileMajorVersion; + unsigned classfileMinorVersion; unsigned interface_count; CRW_ASSERT_CI(ci); @@ -2258,10 +2259,12 @@ inject_class(struct CrwClassImage *ci, } /* minor version number not used */ - (void)copyU2(ci); + classfileMinorVersion = copyU2(ci); /* major version number not used */ - classfileVersion = copyU2(ci); - CRW_ASSERT(ci, classfileVersion <= 50); /* Mustang class files or less */ + classfileMajorVersion = copyU2(ci); + CRW_ASSERT(ci, (classfileMajorVersion <= JVM_CLASSFILE_MAJOR_VERSION) || + ((classfileMajorVersion == JVM_CLASSFILE_MAJOR_VERSION) && + (classfileMinorVersion <= JVM_CLASSFILE_MINOR_VERSION))); cpool_setup(ci); diff --git a/jdk/src/share/javavm/export/classfile_constants.h b/jdk/src/share/javavm/export/classfile_constants.h index d225fa4ce7e..c3ae4cd412a 100644 --- a/jdk/src/share/javavm/export/classfile_constants.h +++ b/jdk/src/share/javavm/export/classfile_constants.h @@ -30,6 +30,10 @@ extern "C" { #endif +/* Classfile version number for this information */ +#define JVM_CLASSFILE_MAJOR_VERSION 51 +#define JVM_CLASSFILE_MINOR_VERSION 0 + /* Flags */ enum {