1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Always evaluate the expression RUBY_ASSERT_MESG_WHEN just once

This commit is contained in:
Nobuyoshi Nakada 2019-07-15 17:45:37 +09:00
parent c20445ab56
commit b452c03a14
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -23,7 +23,7 @@ NORETURN(void rb_assert_failure(const char *, int, const char *, const char *));
((RUBY_DEBUG+0) ? RUBY_ASSERT_MESG((expr), mesg) : \
__builtin_choose_expr( \
__builtin_constant_p(cond), \
__builtin_choose_expr(cond, RUBY_ASSERT_MESG(expr, mesg), (void)0), \
__builtin_choose_expr(cond, RUBY_ASSERT_MESG(expr, mesg), (void)(expr)), \
RUBY_ASSERT_MESG(!(cond) || (expr), mesg)))
#else
# define RUBY_ASSERT_MESG_WHEN(cond, expr, mesg) \