diff mbox series

[uclibc-ng-devel] Re: Bug in memset on ARM

Message ID 164975506987.1938924.10353007161218512362@helium.openadk.org
State Superseded
Headers show
Series [uclibc-ng-devel] Re: Bug in memset on ARM | expand

Commit Message

tombannink@gmail.com April 12, 2022, 9:17 a.m. UTC
From 384c7efdecedaa12d195cce4a45b57d998a5de1d Mon Sep 17 00:00:00 2001
From: Tom Bannink <tombannink@gmail.com>
Date: Tue, 12 Apr 2022 11:15:41 +0200
Subject: [PATCH] Fix bug in ARM memset implementation

---
 libc/string/arm/memset.S | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libc/string/arm/memset.S b/libc/string/arm/memset.S
index 412270f50..4caa08328 100644
--- a/libc/string/arm/memset.S
+++ b/libc/string/arm/memset.S
@@ -32,6 +32,7 @@  memset:
 	cmp	r2, #8		@ at least 8 bytes to do?
 	bcc	2f
 
+	uxtb r1, r1
 	lsl	r3, r1, #8
 	orr	r1, r3
 	lsl	r3, r1, #16
@@ -68,6 +69,7 @@  memset:
 	mov	a4, a1
 	cmp	a3, $8		@ at least 8 bytes to do?
 	blo	2f
+	uxtb a2, a2
 	orr	a2, a2, a2, lsl $8
 	orr	a2, a2, a2, lsl $16
 1: