Module Name:    src
Committed By:   matt
Date:           Sat Jan 26 07:49:11 UTC 2013

Modified Files:
        src/common/lib/libc/arch/arm/string: strchr_arm.S

Log Message:
Fix bug in detecting EOS/match on armv6+.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/string/strchr_arm.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/string/strchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strchr_arm.S:1.2 src/common/lib/libc/arch/arm/string/strchr_arm.S:1.3
--- src/common/lib/libc/arch/arm/string/strchr_arm.S:1.2	Tue Jan 15 16:52:35 2013
+++ src/common/lib/libc/arch/arm/string/strchr_arm.S	Sat Jan 26 07:49:11 2013
@@ -29,7 +29,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: strchr_arm.S,v 1.2 2013/01/15 16:52:35 matt Exp $")
+RCSID("$NetBSD: strchr_arm.S,v 1.3 2013/01/26 07:49:11 matt Exp $")
 
 #ifdef __ARMEL__
 #define	BYTE0	0x000000ff
@@ -92,6 +92,8 @@ ENTRY(strchr)
 	 */
 	mvns	ip, ip			/* did we encounter a NUL? */
 	beq	.Lfind_match		/*   no, find the match */
+	bics	r3, r3, ip		/* clear match for the NUL(s) */
+	beq	.Lnomatch		/*   any left set? if not, no match */
 	movs	ip, ip, lshi #8		/* replicate NUL bit to other bytes */
 	orrne	ip, ip, lshi #8		/* replicate NUL bit to other bytes */
 	orrne	ip, ip, lshi #8		/* replicate NUL bit to other bytes */

Reply via email to