Fix x86-64 __memset_chk.
I can only assume I was testing the 32-bit implementation when I claimed
this worked. While improving the 32-bit code I realized that I'd used
signed comparisons instead of unsigned, and came back to find that the
64-bit code didn't work.
By way of apology, make x86-64 the first architecture where __memset_chk
falls through to memset.
Change-Id: I54d9eee5349b6a2abb2ce81e161fdcde09556561
diff --git a/libc/arch-x86_64/string/sse2-memset-slm.S b/libc/arch-x86_64/string/sse2-memset-slm.S
index 1cf9f4b..fc502c0 100644
--- a/libc/arch-x86_64/string/sse2-memset-slm.S
+++ b/libc/arch-x86_64/string/sse2-memset-slm.S
@@ -43,11 +43,9 @@
ENTRY(__memset_chk)
# %rdi = dst, %rsi = byte, %rdx = n, %rcx = dst_len
- cmp %rdx, %rcx
- jl memset
-
- # TODO: include __memset_chk_fail in the backtrace?
- call PIC_PLT(__memset_chk_fail)
+ cmp %rcx, %rdx
+ ja __memset_chk_fail
+ // Fall through to memset...
END(__memset_chk)