From af204e4c47babdefb307b3f25eb152732c73a533 Mon Sep 17 00:00:00 2001 From: samypr100 <3933065+samypr100@users.noreply.github.com> Date: Fri, 28 Oct 2022 06:13:44 -0400 Subject: [PATCH] [3.10] GH-98671: bpo-46670: Fix #ifdef in sha3module.c (GH-90828) (#98677) --- .../next/Build/2022-10-25-14-43-00.gh-issue-98671.a42a6d.rst | 3 +++ Modules/_sha3/sha3module.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Build/2022-10-25-14-43-00.gh-issue-98671.a42a6d.rst diff --git a/Misc/NEWS.d/next/Build/2022-10-25-14-43-00.gh-issue-98671.a42a6d.rst b/Misc/NEWS.d/next/Build/2022-10-25-14-43-00.gh-issue-98671.a42a6d.rst new file mode 100644 index 000000000000..54b78ed9f2e6 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2022-10-25-14-43-00.gh-issue-98671.a42a6d.rst @@ -0,0 +1,3 @@ +Fix ``NO_MISALIGNED_ACCESSES`` being not defined for the SHA3 extension +when ``HAVE_ALIGNED_REQUIRED`` is set. Allowing builds on hardware that +unaligned memory accesses are not allowed. diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c index 3974e0b6b47f..a2f9d8c75467 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -65,7 +65,7 @@ #endif /* Prevent bus errors on platforms requiring aligned accesses such ARM. */ -#if HAVE_ALIGNED_REQUIRED && !defined(NO_MISALIGNED_ACCESSES) +#if defined(HAVE_ALIGNED_REQUIRED) && !defined(NO_MISALIGNED_ACCESSES) #define NO_MISALIGNED_ACCESSES #endif -- 2.47.3