https://github.com/python/cpython/commit/038495db33723849b1c206e1bf7e3af1e1c41f0a
commit: 038495db33723849b1c206e1bf7e3af1e1c41f0a
branch: main
author: Mark Shannon <[email protected]>
committer: markshannon <[email protected]>
date: 2026-06-04T15:11:33+01:00
summary:

GH-148960: Ensure that asserts are ignored if `NDEBUG` is set (#150916)

files:
M Tools/jit/template.c

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)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to