comparison src/cpu/x86/vm/assembler_x86.cpp @ 1016:d40f03b57795

6890984: Comparison of 2 arrays could cause VM crash Summary: Restore original null checks. Reviewed-by: never, cfang
author kvn
date Wed, 14 Oct 2009 15:03:32 -0700
parents 62001a362ce9
children beb8f45ee9f0 323bd24c6520
comparison
equal deleted inserted replaced
1015:23862fc517bb 1016:d40f03b57795
8632 cmpptr(ary1, ary2); 8632 cmpptr(ary1, ary2);
8633 jcc(Assembler::equal, TRUE_LABEL); 8633 jcc(Assembler::equal, TRUE_LABEL);
8634 8634
8635 if (is_array_equ) { 8635 if (is_array_equ) {
8636 // Need additional checks for arrays_equals. 8636 // Need additional checks for arrays_equals.
8637 andptr(ary1, ary2); 8637 testptr(ary1, ary1);
8638 jcc(Assembler::zero, FALSE_LABEL); // One pointer is NULL 8638 jcc(Assembler::zero, FALSE_LABEL);
8639 testptr(ary2, ary2);
8640 jcc(Assembler::zero, FALSE_LABEL);
8639 8641
8640 // Check the lengths 8642 // Check the lengths
8641 movl(limit, Address(ary1, length_offset)); 8643 movl(limit, Address(ary1, length_offset));
8642 cmpl(limit, Address(ary2, length_offset)); 8644 cmpl(limit, Address(ary2, length_offset));
8643 jcc(Assembler::notEqual, FALSE_LABEL); 8645 jcc(Assembler::notEqual, FALSE_LABEL);