aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-03-03 01:08:15 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-03-03 01:08:15 +0530
commit10e84a28ed9bc1ff18518bada28a488631914678 (patch)
tree6279fbc2ee1a7c79771b5a298c3672a8d0777c81
parent815d8fb21cc0ad1aadbe543f519fcf7899047e9c (diff)
downloadnnn-10e84a28ed9bc1ff18518bada28a488631914678.tar.gz
Both src and dst should be alignment checked separately
The following pattern passes the current check: src - 1010 dst - 0101 mask - 1111
-rw-r--r--nnn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nnn.c b/nnn.c
index 882a470..291c119 100644
--- a/nnn.c
+++ b/nnn.c
@@ -488,7 +488,7 @@ xstrlcpy(char *dest, const char *src, size_t n)
* To enable -O3 ensure src and dest are 16-byte aligned
* More info: http://www.felixcloutier.com/x86/MOVDQA.html
*/
- if ((n >= lsize) && !((ulong)src & (ulong)dest & _ALIGNMENT_MASK)) {
+ if ((n >= lsize) && (((ulong)src & _ALIGNMENT_MASK) == 0 && ((ulong)dest & _ALIGNMENT_MASK) == 0)) {
s = (ulong *)src;
d = (ulong *)dest;
blocks = n >> _WSHIFT;