1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00
freebsd/lib/libc
Robert Clausecker c91cd7d03a lib/libc/amd64/string/strcspn.S: always return earliest match in 17--32 char case
When matching against a set of 17--32 characters, strcspn() uses two
invocations of PCMPISTRI to match against the first 16 characters
of the set and then the remaining characters.  If a match was found in
the first half of the set, the code originally immediately returned
that match.  However, it is possible for a match in the second half of
the set to occur earlier in the vector, leading to that match being
overlooked.

Fix the code by checking if there is a match in the second half of the
set and taking the earlier of the two matches.

The correctness of the function has been verified with extended unit
tests and test runs against the glibc test suite.

Approved by:	mjg (implicit, via IRC)
MFC after:	1 week
MFC to:		stable/14
2023-12-21 03:17:17 +01:00
..
aarch64 libc/*/SYS.h: remove SYCALL macro 2023-12-12 22:52:41 +00:00
amd64 lib/libc/amd64/string/strcspn.S: always return earliest match in 17--32 char case 2023-12-21 03:17:17 +01:00
arm arm/SYS.h: align with other arches 2023-12-18 22:28:42 +00:00
capability capsicum: introduce cap_rights_is_empty Function 2023-12-11 12:15:46 +01:00
compat-43 lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
csu libc: Purge unneeded cdefs.h 2023-11-01 16:44:30 -06:00
db lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
gdtoa libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
gen libc: expose execvpe for Linux compat 2023-12-11 19:24:53 +00:00
gmon lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
i386 {amd64,i386}/SYS.h: add _SYSCALL and _SYSCALL_BODY 2023-12-18 22:28:42 +00:00
iconv libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
include libc: expose execvpe for Linux compat 2023-12-11 19:24:53 +00:00
inet lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
isc lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
locale lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
md Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
nameser lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
net lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
nls libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
posix1e libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(3) 2023-12-18 00:06:03 +02:00
powerpc libc/*/SYS.h: remove SYCALL macro 2023-12-12 22:52:41 +00:00
powerpc64 libc/*/SYS.h: remove SYCALL macro 2023-12-12 22:52:41 +00:00
powerpcspe libc/<arch>/sys/Makefile.inc: remove cruft 2023-11-15 17:50:53 +00:00
quad Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
regex lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
resolv lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
riscv riscv/SYS.h: implement _SYSCALL_BODY() macro 2023-12-18 22:28:42 +00:00
rpc lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
secure libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
softfloat libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
stdio lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
stdlib strfmon.c: Use the restrict keyword directly 2023-12-10 23:28:25 +02:00
stdtime Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
string lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
sys Remove _POSIX_PRIORITIZED_IO references from man pages 2023-12-18 08:06:55 -07:00
tests lib/libc/tests/string/strcspn_test.c: add test for correct match order 2023-12-21 03:16:57 +01:00
uuid libc: Remove empty comments in Symbol.map 2023-11-15 17:51:03 +00:00
x86 libc/<arch>/sys/Makefile.inc: remove cruft 2023-11-15 17:50:53 +00:00
xdr lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
yp lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
libc_nossp.ldscript Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
libc.ldscript Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
Makefile lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
Makefile.depend dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
Makefile.depend.options Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Versions.def Create namespace for the symbols added during 15-CURRENT cycle 2023-09-22 10:16:29 +02:00