mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 03:27:46 +08:00
* libc/machine/aarch64/memchr.S: Add check for zero-sized buffer.
This commit is contained in:
parent
de1c312566
commit
59c3d5a1a4
@ -1,3 +1,7 @@
|
||||
2014-08-19 Richard Earnshaw <rearnsha@arm.com>
|
||||
|
||||
* libc/machine/aarch64/memchr.S: Add check for zero-sized buffer.
|
||||
|
||||
2014-08-18 Corinna Vinschen <vinschen@redhat.com>
|
||||
|
||||
* libc/include/sys/signal.h: Declare sigaltstack for RTEMS only.
|
||||
|
@ -79,6 +79,8 @@
|
||||
.endm
|
||||
|
||||
def_fn memchr
|
||||
/* Do not dereference srcin if no bytes to compare. */
|
||||
cbz cntin, .Lzero_length
|
||||
/*
|
||||
* Magic constant 0x40100401 allows us to identify which lane matches
|
||||
* the requested byte.
|
||||
@ -166,5 +168,9 @@ def_fn memchr
|
||||
csel result, xzr, result, eq
|
||||
ret
|
||||
|
||||
.Lzero_length:
|
||||
mov result, #0
|
||||
ret
|
||||
|
||||
.size memchr, . - memchr
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user