]> git.eshelyaron.com Git - emacs.git/commit
Make string-lessp vectorisation safer
authorMattias Engdegård <mattiase@acm.org>
Fri, 31 Mar 2023 18:13:18 +0000 (20:13 +0200)
committerMattias Engdegård <mattiase@acm.org>
Fri, 31 Mar 2023 19:37:53 +0000 (21:37 +0200)
commit6523359dfe212633f5bd274b29a1f5e613384c79
treea8ad810602390d85bbd19297b8e09d647ed53968
parent6f496105e392af45c2248b4523ef19804837a8a6
Make string-lessp vectorisation safer

Use memcpy for loading unaligned words on platforms where this can be
done efficiently.  This guards against problems arising from future
compiler autovectorisation improvements that might cause instructions
that require aligned addresses to be emitted, and should also work
with an address sanitiser enabled.

* src/fns.c (HAVE_FAST_UNALIGNED_ACCESS): Only define when optimising.
(load_unaligned_size_t): New.
(Fstring_lessp): Use load_unaligned_size_t.
* src/lisp.h (UNALIGNED_LOAD_SIZE): Remove now unused macro.
src/fns.c
src/lisp.h