]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
sparc: Fix sparc64 memmove length comparison (BZ 31266)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 18 Jan 2024 13:52:18 +0000 (10:52 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 22 Jan 2024 12:34:50 +0000 (09:34 -0300)
The small counts copy bytes comparsion should be unsigned (as the
memmove size argument).  It fixes string/tst-memmove-overflow on
sparcv9, where the input size triggers an invalid code path.

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

sysdeps/sparc/sparc64/memmove.S

index 8803a03d4e9f565152f69c90a5a29ef676c5d7c1..f14b09afafdd9ec107b795e8fa206ace15feec20 100644 (file)
@@ -38,7 +38,7 @@ ENTRY(memmove)
 /*
  * normal, copy forwards
  */
-2:     ble     %XCC, .Ldbytecp
+2:     bleu    %XCC, .Ldbytecp
         andcc  %o1, 3, %o5     /* is src word aligned  */
        bz,pn   %icc, .Laldst
         cmp    %o5, 2          /* is src half-word aligned  */