提交 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
...@@ -61,8 +61,9 @@ ...@@ -61,8 +61,9 @@
# include "bytes_ppc.hpp" # include "bytes_ppc.hpp"
#endif #endif
#define NOFAILOVER_MAJOR_VERSION 51 #define NOFAILOVER_MAJOR_VERSION 51
#define STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION 52 #define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51
#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,16 +2028,19 @@ void ClassVerifier::verify_switch( ...@@ -2027,16 +2028,19 @@ 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);
// 4639449 & 4647081: padding bytes must be 0 if (_klass->major_version() < NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION) {
u2 padding_offset = 1; // 4639449 & 4647081: padding bytes must be 0
while ((bcp + padding_offset) < aligned_bcp) { u2 padding_offset = 1;
if(*(bcp + padding_offset) != 0) { while ((bcp + padding_offset) < aligned_bcp) {
verify_error(ErrorContext::bad_code(bci), if(*(bcp + padding_offset) != 0) {
"Nonzero padding byte in lookswitch or tableswitch"); verify_error(ErrorContext::bad_code(bci),
return; "Nonzero padding byte in lookswitch or tableswitch");
return;
}
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.
先完成此消息的编辑!
想要评论请 注册