Skip to content

Commit

Permalink
Removed extra stringization
Browse files Browse the repository at this point in the history
Argument of RUBY_ASSERT_FAIL is already stringized message, so no
more extra stringization should be applied.
  • Loading branch information
nobu committed May 12, 2020
1 parent 3fcf7f0 commit 237bee9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/ruby/assert.h
Expand Up @@ -62,8 +62,8 @@ RBIMPL_SYMBOL_EXPORT_END()
# define RBIMPL_ASSERT_FUNC RBIMPL_CAST((const char *)0)
#endif

#define RUBY_ASSERT_FAIL(expr) \
rb_assert_failure(__FILE__, __LINE__, RBIMPL_ASSERT_FUNC, #expr)
#define RUBY_ASSERT_FAIL(mesg) \
rb_assert_failure(__FILE__, __LINE__, RBIMPL_ASSERT_FUNC, mesg)

#define RUBY_ASSERT_MESG(expr, mesg) \
(RB_LIKELY(expr) ? RBIMPL_ASSERT_NOTHING : RUBY_ASSERT_FAIL(mesg))
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/internal/globals.h
Expand Up @@ -148,7 +148,7 @@ rb_class_of(VALUE obj)
#if RUBY_NDEBUG
RBIMPL_UNREACHABLE_RETURN(Qfalse);
#else
RUBY_ASSERT_FAIL(rb_class_of);
RUBY_ASSERT_FAIL("unexpected type");
#endif
}

Expand Down

0 comments on commit 237bee9

Please sign in to comment.