mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Fixing JERRY_ASSERT macro for JERRY_NDEBUG build mode.
The macro under !JERRY_NDEBUG was evaluting it's argument and called jerry_assert_fail if the argument was evaluated to false. Under JERRY_NDEBUG the macro still was evaluating it's argument but jerry_assert_fail wasn't called anyway. Now macro doesn't evaluate it's argument under JERRY_NDEBUG build.
This commit is contained in:
parent
857e66fb98
commit
44eca8e207
@ -115,7 +115,7 @@ extern void __noreturn jerry_unimplemented (const char *comment, const char *fil
|
||||
#define JERRY_ASSERT(x) do { if (__builtin_expect (!(x), 0)) { \
|
||||
jerry_assert_fail (#x, __FILE__, __FUNCTION__, __LINE__); } } while (0)
|
||||
#else /* !JERRY_NDEBUG */
|
||||
#define JERRY_ASSERT(x) (void) (x)
|
||||
#define JERRY_ASSERT(x) do { if (false) { (void)(x); } } while (0)
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user