Skip to content

Commit 485fcd0

Browse files
committed
Ensure that asserts are ignored if NDEBUG is set
1 parent 3ff2117 commit 485fcd0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Tools/jit/template.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
#include "Python.h"
33

4+
#ifndef NDEBUG
45
#undef assert
56
#define assert(TEST) ((TEST) ? 0 : _Py_jit_assertion_failure(__LINE__))
7+
#endif
68

79
#include "pycore_backoff.h"
810
#include "pycore_call.h"
@@ -40,8 +42,10 @@
4042

4143
#include "jit.h"
4244

45+
#ifndef NDEBUG
4346
#undef assert
4447
#define assert(TEST) ((TEST) ? 0 : _Py_jit_assertion_failure(__LINE__))
48+
#endif
4549

4650
#undef CURRENT_OPERAND0_64
4751
#define CURRENT_OPERAND0_64() (_operand0_64)

0 commit comments

Comments
 (0)