Skip to content

Commit 64e4aa2

Browse files
author
Andrew Haley
committedNov 22, 2024
8339916: AIOOBE due to Math.abs(Integer.MIN_VALUE) in tests
Reviewed-by: shade
1 parent bf374c3 commit 64e4aa2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎test/micro/org/openjdk/bench/vm/lang/TypePollution.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int instanceOfInterfaceSwitch() {
178178
probe ^= probe << 13; // xorshift
179179
probe ^= probe >>> 17;
180180
probe ^= probe << 5;
181-
dummy += switch(objectArray[Math.abs(probe) % objectArray.length]) {
181+
dummy += switch(objectArray[(probe & Integer.MAX_VALUE) % objectArray.length]) {
182182
case I01 inst -> 1;
183183
case I02 inst -> 2;
184184
case I03 inst -> 3;
@@ -192,7 +192,7 @@ int instanceOfInterfaceSwitch() {
192192
probe ^= probe << 13; // xorshift
193193
probe ^= probe >>> 17;
194194
probe ^= probe << 5;
195-
dummy += switch(objectArray[Math.abs(probe) % objectArray.length]) {
195+
dummy += switch(objectArray[(probe & Integer.MAX_VALUE) % objectArray.length]) {
196196
case I18 inst -> 8;
197197
case I17 inst -> 7;
198198
case I16 inst -> 6;

0 commit comments

Comments
 (0)
Please sign in to comment.