summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-15 17:45:37 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-15 17:45:37 +0900
commitb452c03a14f943ae25338547bd680fce67399d85 (patch)
tree3d55cb2f818b0316b7358d4e94f112ca523e1e0c /include
parentc20445ab561b6b74bc60787b7c7f69795986e4a3 (diff)
Always evaluate the expression RUBY_ASSERT_MESG_WHEN just once
Diffstat (limited to 'include')
-rw-r--r--include/ruby/assert.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/assert.h b/include/ruby/assert.h
index d19d8e4e32..bdc0234c58 100644
--- a/include/ruby/assert.h
+++ b/include/ruby/assert.h
@@ -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) \