File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
test/functional/UnsafeTest/src_90/org/openj9/test/unsafe Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -967,7 +967,12 @@ private void testCopyLargeArrayIntoRawMemory(Class arrayClass) {
967
967
Array .setByte (array , i , (byte ) (i % Byte .SIZE ));
968
968
}
969
969
970
- for (long arrayOffset = baseOffset ; arrayOffset < (baseOffset + maxNumBytes ); arrayOffset = arrayOffset * 11 - 1 ) {
970
+ /*
971
+ For off-heap eanbled case initial arrayOffset would be 0 (baseOffset=0),
972
+ cause the next arrayOffset in loop become to negative (arrayOffset*11-1),
973
+ update logic for the next arrayOffset to avoid negative offset test case.
974
+ */
975
+ for (long arrayOffset = baseOffset ; arrayOffset < (baseOffset + maxNumBytes ); arrayOffset = ((arrayOffset ==0 ) ? 16 : arrayOffset ) * 11 - 1 ) {
971
976
long maxNumBytesLeft = ((baseOffset + maxNumBytes ) - arrayOffset );
972
977
for (long numBytesToCopy = 1 ; numBytesToCopy < maxNumBytesLeft ; numBytesToCopy = (numBytesToCopy + 1 )
973
978
* numBytesToCopy ) {
You can’t perform that action at this time.
0 commit comments