about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc64/fpu/s_signbitl.S
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2024-07-11 11:28:53 +0200
committerStefan Liebler <stli@linux.ibm.com>2024-07-11 15:08:57 +0200
commit9b7651410375ec8848a1944992d663d514db4ba7 (patch)
tree8fffd0aee3fc1510bdfb93b96f44a2ceafc90bbb /sysdeps/sparc/sparc64/fpu/s_signbitl.S
parent2e456ccf0c34a056e3ccafac4a0c7effef14d918 (diff)
downloadglibc-master.tar.gz
glibc-master.tar.xz
glibc-master.zip
s390x: Fix segfault in wcsncmp [BZ #31934] HEAD master
The z13/vector-optimized wcsncmp implementation segfaults if n=1
and there is only one character (equal on both strings) before
the page end.  Then it loads and compares one character and misses
to check n again.  The following load fails.

This patch removes the extra load and compare of the first character
and just start with the loop which uses vector-load-to-block-boundary.
This code-path also checks n.

With this patch both tests are passing:
- the simplified one mentioned in the bugzilla 31934
- the full one in Florian Weimer's patch:
"manual: Document a GNU extension for strncmp/wcsncmp"
(https://patchwork.sourceware.org/project/glibc/patch/874j9eml6y.fsf@oldenburg.str.redhat.com/):
On s390x-linux-gnu (z16), the new wcsncmp test fails due to bug 31934.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/sparc/sparc64/fpu/s_signbitl.S')
0 files changed, 0 insertions, 0 deletions