提交 26663c70 编写于 作者: Z zmajo

8171155: Scanning method file for initialized final field updates can fail for non-existent fields

Summary: Check if field exists before possibly marking it as having initialized final updates.
Reviewed-by: stsmirno, vlivanov, coleenp
上级 1e286cfb
......@@ -416,15 +416,16 @@ void Rewriter::scan_method(Method* method, bool reverse, bool* invokespecial_err
Symbol* field_sig = cp->signature_ref_at(bc_index);
fieldDescriptor fd;
klass->find_field(field_name, field_sig, &fd);
if (fd.access_flags().is_final()) {
if (fd.access_flags().is_static()) {
if (!method->is_static_initializer()) {
fd.set_has_initialized_final_update(true);
}
} else {
if (!method->is_object_initializer()) {
fd.set_has_initialized_final_update(true);
if (klass->find_field(field_name, field_sig, &fd) != NULL) {
if (fd.access_flags().is_final()) {
if (fd.access_flags().is_static()) {
if (!method->is_static_initializer()) {
fd.set_has_initialized_final_update(true);
}
} else {
if (!method->is_object_initializer()) {
fd.set_has_initialized_final_update(true);
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册