From df1c0486c5c7e88e9a5a3bd8a4335fc74c4963fc Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 4 May 2025 23:49:39 +0200 Subject: Fix strings search looping --- boot/common-boot.s | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'boot/common-boot.s') diff --git a/boot/common-boot.s b/boot/common-boot.s index a6fb04e..2a192d3 100644 --- a/boot/common-boot.s +++ b/boot/common-boot.s @@ -425,6 +425,9 @@ _memcpy: addi a0, a0, 1 addi a1, a1, 1 + addi a2, a2, -1 + + j .Lmemcpy_loop .Lmemcpy_end: mv a0, t0 @@ -473,6 +476,8 @@ _strings_index: beqz a0, .Lstrings_index_end .Lstrings_index_next: + # Advance the pointer, reduce the length. + lw a2, (s2) addi s2, s2, 4 add s2, s2, a2 addi s1, s1, -1 -- cgit v1.2.3