From 485fcd01fda13869917dcd779523b3732709db7e Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Thu, 4 Jun 2026 12:22:41 +0100 Subject: [PATCH] Ensure that asserts are ignored if NDEBUG is set --- Tools/jit/template.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tools/jit/template.c b/Tools/jit/template.c index 72379165f3b610e..f1e2e25aaecdada 100644 --- a/Tools/jit/template.c +++ b/Tools/jit/template.c @@ -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" @@ -40,8 +42,10 @@ #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)