]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-148960: Ensure that asserts are ignored if `NDEBUG` is set (#150916)
authorMark Shannon <Mark.Shannon@arm.com>
Thu, 4 Jun 2026 14:11:33 +0000 (15:11 +0100)
committerGitHub <noreply@github.com>
Thu, 4 Jun 2026 14:11:33 +0000 (15:11 +0100)
Tools/jit/template.c

index 72379165f3b610e85f500aa80a0bf0a514e0328e..f1e2e25aaecdadabd37ae9bceaeb51b5cd48f2ab 100644 (file)
@@ -1,8 +1,10 @@
 
 #include "Python.h"
 
+#ifndef NDEBUG
 #undef assert
 #define assert(TEST) ((TEST) ? 0 : _Py_jit_assertion_failure(__LINE__))
+#endif
 
 #include "pycore_backoff.h"
 #include "pycore_call.h"
 
 #include "jit.h"
 
+#ifndef NDEBUG
 #undef assert
 #define assert(TEST) ((TEST) ? 0 : _Py_jit_assertion_failure(__LINE__))
+#endif
 
 #undef CURRENT_OPERAND0_64
 #define CURRENT_OPERAND0_64() (_operand0_64)