Skip to content

Commit 385070e

Browse files
committed
Fix too small bytearray in unsafe test
1 parent 4db571a commit 385070e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ea/PartialEscapeUnsafeStoreTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
*/
2525
package jdk.graal.compiler.core.test.ea;
2626

27-
import jdk.graal.compiler.core.test.GraalCompilerTest;
2827
import org.junit.Test;
2928

29+
import jdk.graal.compiler.core.test.GraalCompilerTest;
30+
3031
/**
3132
* Exercise a mix of unsafe and normal reads ands writes in situations where EA might attempt to
3233
* fold the operations.
@@ -557,7 +558,7 @@ public void testByteArrayWithIntStoreAndRead() {
557558
}
558559

559560
public static byte testByteArrayWithLongStoreAndReadSnippet(long v) {
560-
byte[] b = new byte[4];
561+
byte[] b = new byte[8];
561562
UNSAFE.putLong(b, byteArrayBaseOffset, v);
562563
return b[(byteSize / longSize) + 1];
563564
}
@@ -579,7 +580,7 @@ public void testByteArrayWithFloatStoreAndRead() {
579580
}
580581

581582
public static byte testByteArrayWithDoubleStoreAndReadSnippet(double v) {
582-
byte[] b = new byte[4];
583+
byte[] b = new byte[8];
583584
UNSAFE.putDouble(b, byteArrayBaseOffset, v);
584585
return b[(byteSize / doubleSize) + 1];
585586
}

0 commit comments

Comments
 (0)