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:
Ruben Ayrapetyan 2014-11-17 12:45:40 +03:00
parent 857e66fb98
commit 44eca8e207

View File

@ -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 */
/**