提交 91c5ad3a 编写于 作者: K kamg

7166498: JVM crash in ClassVerifier

Summary: Fixed raw pointer being used after potential safepoint/GC
Reviewed-by: acorn, fparain, dholmes
上级 abd1b417
...@@ -1738,10 +1738,14 @@ void ClassVerifier::verify_switch( ...@@ -1738,10 +1738,14 @@ void ClassVerifier::verify_switch(
int target = bci + default_offset; int target = bci + default_offset;
stackmap_table->check_jump_target(current_frame, target, CHECK_VERIFY(this)); stackmap_table->check_jump_target(current_frame, target, CHECK_VERIFY(this));
for (int i = 0; i < keys; i++) { for (int i = 0; i < keys; i++) {
// Because check_jump_target() may safepoint, the bytecode could have
// moved, which means 'aligned_bcp' is no good and needs to be recalculated.
aligned_bcp = (address)round_to((intptr_t)(bcs->bcp() + 1), jintSize);
target = bci + (jint)Bytes::get_Java_u4(aligned_bcp+(3+i*delta)*jintSize); target = bci + (jint)Bytes::get_Java_u4(aligned_bcp+(3+i*delta)*jintSize);
stackmap_table->check_jump_target( stackmap_table->check_jump_target(
current_frame, target, CHECK_VERIFY(this)); current_frame, target, CHECK_VERIFY(this));
} }
NOT_PRODUCT(aligned_bcp = NULL); // no longer valid at this point
} }
bool ClassVerifier::name_in_supers( bool ClassVerifier::name_in_supers(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册