From 11a5fb92d552acd2e944744ae1af5700d5bccee2 Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 27 May 2025 03:43:54 +0100 Subject: [PATCH] gh-134768: Fix definition of `mt_continue_should_break()` In 121ed71f4e395948d313249b2ad33e1e21581f8a, mt_continue_should_break was changed to be guarded by `Py_DEBUG`, but it's used in `compress_mt_continue_lock_held` with just `assert`, so it needs to be available when `NDEBUG` is undefined too. `Py_DEBUG` implies `NDEBUG` is undefined, so we can check just that. Fixes: 121ed71f4e395948d313249b2ad33e1e21581f8a --- Modules/_zstd/compressor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_zstd/compressor.c b/Modules/_zstd/compressor.c index 7f0558909b4422..6e61380a2db18a 100644 --- a/Modules/_zstd/compressor.c +++ b/Modules/_zstd/compressor.c @@ -489,7 +489,7 @@ compress_lock_held(ZstdCompressor *self, Py_buffer *data, return NULL; } -#ifdef Py_DEBUG +#ifndef NDEBUG static inline int mt_continue_should_break(ZSTD_inBuffer *in, ZSTD_outBuffer *out) {