From efbf6e5f0932e6c1a4250f91ee99059f449f2470 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sat, 1 Jun 2019 19:01:21 +0300 Subject: liblzma: Use unaligned_readXXne functions instead of type punning. Now gcc -fsanitize=undefined should be clean. Thanks to Jeffrey Walton. --- src/liblzma/lzma/lzma_encoder_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/liblzma/lzma/lzma_encoder_private.h') 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]) -- cgit v1.2.3