Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/common/lib/libc/arch/arm/string Pull up following revisio...



details:   https://anonhg.NetBSD.org/src/rev/346a14bdaa72
branches:  netbsd-9
changeset: 373116:346a14bdaa72
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jan 19 10:37:03 2023 +0000

description:
Pull up following revision(s) (requested by skrll in ticket #1567):

        common/lib/libc/arch/arm/string/strlen_arm.S: revision 1.11

Fix strnlen with a large maxlen argument by using unsigned comparison
conditions - from mlelstv.

I had a similar, but not quite as good patch.

diffstat:

 common/lib/libc/arch/arm/string/strlen_arm.S |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 2d866009f81a -r 346a14bdaa72 common/lib/libc/arch/arm/string/strlen_arm.S
--- a/common/lib/libc/arch/arm/string/strlen_arm.S      Wed Jan 18 19:29:16 2023 +0000
+++ b/common/lib/libc/arch/arm/string/strlen_arm.S      Thu Jan 19 10:37:03 2023 +0000
@@ -29,7 +29,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: strlen_arm.S,v 1.9 2014/05/06 16:02:11 joerg Exp $")
+RCSID("$NetBSD: strlen_arm.S,v 1.9.26.1 2023/01/19 10:37:03 martin Exp $")
 
 #if defined(__thumb__) && !defined(_ARM_ARCH_T2)
 #error Only Thumb2 or ARM supported
@@ -102,7 +102,7 @@
 .Lmain_loop:
 #ifdef STRNLEN
        cmp     r0, r5                  /* gone too far? */
-       bge     .Lmaxed_out             /*   yes, return maxlen */
+       bhs     .Lmaxed_out             /*   yes, return maxlen */
 #endif
        ldr     r3, [r0], #4            /* load next word */
 #if defined(_ARM_ARCH_6)
@@ -164,9 +164,9 @@
 #ifdef STRNLEN
        cmp     r0, r4                  /* is it larger than maxlen? */
 #ifdef __thumb__
-       it      gt
+       it      hi
 #endif
-       movgt   r0, r4                  /*   yes, return maxlen */
+       movhi   r0, r4                  /*   yes, return maxlen */
        pop     {r4, r5}                /* restore registers */
 #endif
        RET                             /* return */



Home | Main Index | Thread Index | Old Index