aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-10-20 21:53:35 +0300
committerLasse Collin <lasse.collin@tukaani.org>2024-01-11 14:29:38 +0200
commit9523c1300d22fa715765c181cf991d14d6112fb1 (patch)
tree408cdcc07391b21ce297137ba937852eafd16f3a /src/liblzma
parentliblzma: CRC: Add empty lines. (diff)
downloadxz-9523c1300d22fa715765c181cf991d14d6112fb1.tar.xz
liblzma: #define crc_attr_no_sanitize_address in crc_common.h.
Diffstat (limited to 'src/liblzma')
-rw-r--r--src/liblzma/check/crc_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/liblzma/check/crc_common.h b/src/liblzma/check/crc_common.h
index 4764eb17..c949f793 100644
--- a/src/liblzma/check/crc_common.h
+++ b/src/liblzma/check/crc_common.h
@@ -39,6 +39,16 @@
#endif
+// CRC CLMUL code needs this because accessing input buffers that aren't
+// aligned to the vector size will inherently trip the address sanitizer.
+#if lzma_has_attribute(__no_sanitize_address__)
+# define crc_attr_no_sanitize_address \
+ __attribute__((__no_sanitize_address__))
+#else
+# define crc_attr_no_sanitize_address
+#endif
+
+
// The inline keyword is only a suggestion to the compiler to substitute the
// body of the function into the places where it is called. If a function
// is large and called multiple times then compiler may choose to ignore the