aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_encoder_private.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2019-06-01 19:01:21 +0300
committerLasse Collin <lasse.collin@tukaani.org>2019-06-01 19:01:21 +0300
commit33773c6f2a8711d4aa6656795db52c59a28580ec (patch)
treea1f059705643278ad2fcb25b645889158a4d7aa2 /src/liblzma/lzma/lzma_encoder_private.h
parenttuklib_integer: Autodetect support for unaligned access on ARM. (diff)
downloadxz-33773c6f2a8711d4aa6656795db52c59a28580ec.tar.xz
liblzma: Use unaligned_readXXne functions instead of type punning.
Now gcc -fsanitize=undefined should be clean. Thanks to Jeffrey Walton.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lzma/lzma_encoder_private.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/lzma/lzma_encoder_private.h b/src/liblzma/lzma/lzma_encoder_private.h
index a2da969f..e3d79429 100644
--- a/src/liblzma/lzma/lzma_encoder_private.h
+++ b/src/liblzma/lzma/lzma_encoder_private.h
@@ -26,7 +26,7 @@
// reason to not use it when it is supported.
#ifdef TUKLIB_FAST_UNALIGNED_ACCESS
# define not_equal_16(a, b) \
- (*(const uint16_t *)(a) != *(const uint16_t *)(b))
+ (unaligned_read16ne(a) != unaligned_read16ne(b))
#else
# define not_equal_16(a, b) \
((a)[0] != (b)[0] || (a)[1] != (b)[1])