提交 0aa5b035 编写于 作者: H hseigel

8010667: Non-zero padding is not allowed in splitverifier for...

8010667: Non-zero padding is not allowed in splitverifier for tableswitch/lookupswitch instructions.
Summary: Don't check the padding bits if class file version is >= 51.
Reviewed-by: kvn, dholmes, coleenp
上级 545edf77
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#endif #endif
#define NOFAILOVER_MAJOR_VERSION 51 #define NOFAILOVER_MAJOR_VERSION 51
#define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51
#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52 #define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52
// Access to external entry for VerifyClassCodes - old byte code verifier // Access to external entry for VerifyClassCodes - old byte code verifier
...@@ -2027,6 +2028,7 @@ void ClassVerifier::verify_switch( ...@@ -2027,6 +2028,7 @@ void ClassVerifier::verify_switch(
address bcp = bcs->bcp(); address bcp = bcs->bcp();
address aligned_bcp = (address) round_to((intptr_t)(bcp + 1), jintSize); address aligned_bcp = (address) round_to((intptr_t)(bcp + 1), jintSize);
if (_klass->major_version() < NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION) {
// 4639449 & 4647081: padding bytes must be 0 // 4639449 & 4647081: padding bytes must be 0
u2 padding_offset = 1; u2 padding_offset = 1;
while ((bcp + padding_offset) < aligned_bcp) { while ((bcp + padding_offset) < aligned_bcp) {
...@@ -2037,6 +2039,8 @@ void ClassVerifier::verify_switch( ...@@ -2037,6 +2039,8 @@ void ClassVerifier::verify_switch(
} }
padding_offset++; padding_offset++;
} }
}
int default_offset = (int) Bytes::get_Java_u4(aligned_bcp); int default_offset = (int) Bytes::get_Java_u4(aligned_bcp);
int keys, delta; int keys, delta;
current_frame->pop_stack( current_frame->pop_stack(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册