]> Savannah Git Hosting - gnulib.git/commit
crc-x86_64: better fix for unaligned access
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jan 2025 18:27:55 +0000 (10:27 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jan 2025 18:28:31 +0000 (10:28 -0800)
commitc89cd7c1b57ebbc1436959c8bff1297215e9d08c
tree93b5fedda0b6098c6033e06dd3d6b1cc7576fea9
parent2481e7a50d6535582856626b53009f419e2e05e2
crc-x86_64: better fix for unaligned access

Avoid undefined behavior in a way that doesn’t require
the input buffer to be aligned.
From a suggestion by Lasse Collin in:
https://lists.gnu.org/r/bug-gnulib/2025-01/msg00148.html
* lib/crc-x86_64-pclmul.c (crc32_update_no_xor_pclmul):
Since the const void * pointer ‘buf’ might not be aligned,
assign it to const __m128i_u * instead of to const __m128i *.
* lib/crc.c (crc32_update_no_xor):
Remove recently-addeda check for buffer alignment.
ChangeLog
lib/crc-x86_64-pclmul.c
lib/crc.c