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

Andrew Haley aph at redhat.com
Wed Feb 26 17:39:07 UTC 2020


Hi,

On 2/26/20 12:51 PM, Alexey Bakhtin wrote:
> 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);

Looks good, thanks. Can you please have a look at JDK 8u and 11u, to see
if the bug is there too? Then we can set backport flags.

The 8u repo is at
http://hg.openjdk.java.net/aarch64-port/jdk8u-shenandoah/hotspot/

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the jdk-dev mailing list