提交 983c3b27 编写于 作者: K kvn

6890984: Comparison of 2 arrays could cause VM crash

Summary: Restore original null checks.
Reviewed-by: never, cfang
上级 c290e324
......@@ -3016,7 +3016,7 @@ enc_class enc_Array_Equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, notemp_iRegI r
// return true if the same array
__ cmp(ary1_reg, ary2_reg);
__ br(Assembler::equal, true, Assembler::pn, Ldone);
__ brx(Assembler::equal, true, Assembler::pn, Ldone);
__ delayed()->add(G0, 1, result_reg); // equal
__ br_null(ary1_reg, true, Assembler::pn, Ldone);
......
......@@ -8634,8 +8634,10 @@ void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Regist
if (is_array_equ) {
// Need additional checks for arrays_equals.
andptr(ary1, ary2);
jcc(Assembler::zero, FALSE_LABEL); // One pointer is NULL
testptr(ary1, ary1);
jcc(Assembler::zero, FALSE_LABEL);
testptr(ary2, ary2);
jcc(Assembler::zero, FALSE_LABEL);
// Check the lengths
movl(limit, Address(ary1, length_offset));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册