提交 f1793cff 编写于 作者: O ohair

6855180: Fix classfile version check in java_crw_demo

Reviewed-by: jjg
上级 489c0042
......@@ -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);
......
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册