Wed, 14 Oct 2009 15:03:32 -0700
6890984: Comparison of 2 arrays could cause VM crash
Summary: Restore original null checks.
Reviewed-by: never, cfang
src/cpu/sparc/vm/sparc.ad | file | annotate | diff | comparison | revisions | |
src/cpu/x86/vm/assembler_x86.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/sparc/vm/sparc.ad Wed Oct 14 11:42:59 2009 -0700 1.2 +++ b/src/cpu/sparc/vm/sparc.ad Wed Oct 14 15:03:32 2009 -0700 1.3 @@ -3016,7 +3016,7 @@ 1.4 1.5 // return true if the same array 1.6 __ cmp(ary1_reg, ary2_reg); 1.7 - __ br(Assembler::equal, true, Assembler::pn, Ldone); 1.8 + __ brx(Assembler::equal, true, Assembler::pn, Ldone); 1.9 __ delayed()->add(G0, 1, result_reg); // equal 1.10 1.11 __ br_null(ary1_reg, true, Assembler::pn, Ldone);
2.1 --- a/src/cpu/x86/vm/assembler_x86.cpp Wed Oct 14 11:42:59 2009 -0700 2.2 +++ b/src/cpu/x86/vm/assembler_x86.cpp Wed Oct 14 15:03:32 2009 -0700 2.3 @@ -8634,8 +8634,10 @@ 2.4 2.5 if (is_array_equ) { 2.6 // Need additional checks for arrays_equals. 2.7 - andptr(ary1, ary2); 2.8 - jcc(Assembler::zero, FALSE_LABEL); // One pointer is NULL 2.9 + testptr(ary1, ary1); 2.10 + jcc(Assembler::zero, FALSE_LABEL); 2.11 + testptr(ary2, ary2); 2.12 + jcc(Assembler::zero, FALSE_LABEL); 2.13 2.14 // Check the lengths 2.15 movl(limit, Address(ary1, length_offset));