From: Mark Shannon Date: Thu, 4 Jun 2026 14:11:33 +0000 (+0100) Subject: GH-148960: Ensure that asserts are ignored if `NDEBUG` is set (#150916) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=038495db33723849b1c206e1bf7e3af1e1c41f0a;p=thirdparty%2FPython%2Fcpython.git GH-148960: Ensure that asserts are ignored if `NDEBUG` is set (#150916) --- diff --git a/Tools/jit/template.c b/Tools/jit/template.c index 72379165f3b6..f1e2e25aaecd 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)