JDK-8239787 : AArch64: String.indexOf may incorrectly handle empty strings

Alexey Bakhtin alexey at azul.com
Wed Feb 26 12:51:58 UTC 2020


Hello,

Could you please review fix for aarch64 related issue:  https://bugs.openjdk.java.net/browse/JDK-8239787

The fix verifies length of the string at the beginning of string_indexof_char intrinsic code :

diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
@@ -4860,6 +4860,8 @@
   Register ch1 = rscratch1;
   Register result_tmp = rscratch2;

+ cbz(cnt1, NOMATCH);
+
   cmp(cnt1, (u1)4);
   br(LT, DO1_SHORT);

Thank you
Alexey



More information about the jdk-dev mailing list