[前][次][番号順一覧][スレッド一覧]

ruby-changes:61203

From: Nobuyoshi <ko1@a...>
Date: Tue, 12 May 2020 10:24:09 +0900 (JST)
Subject: [ruby-changes:61203] 237bee9d40 (master): Removed extra stringization

https://git.ruby-lang.org/ruby.git/commit/?id=237bee9d40

From 237bee9d40cbc9d1067694f84793985cc4621cbc Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 12 May 2020 10:21:05 +0900
Subject: Removed extra stringization

Argument of RUBY_ASSERT_FAIL is already stringized message, so no
more extra stringization should be applied.

diff --git a/include/ruby/assert.h b/include/ruby/assert.h
index 7e59da6..ac9b9c8 100644
--- a/include/ruby/assert.h
+++ b/include/ruby/assert.h
@@ -62,8 +62,8 @@ RBIMPL_SYMBOL_EXPORT_END() https://github.com/ruby/ruby/blob/trunk/include/ruby/assert.h#L62
 # 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))
diff --git a/include/ruby/internal/globals.h b/include/ruby/internal/globals.h
index 8269591..e0bef2d 100644
--- a/include/ruby/internal/globals.h
+++ b/include/ruby/internal/globals.h
@@ -148,7 +148,7 @@ rb_class_of(VALUE obj) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/globals.h#L148
 #if RUBY_NDEBUG
     RBIMPL_UNREACHABLE_RETURN(Qfalse);
 #else
-    RUBY_ASSERT_FAIL(rb_class_of);
+    RUBY_ASSERT_FAIL("unexpected type");
 #endif
 }
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]