summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-03 10:15:22 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-03 10:15:22 +0000
commit759d12889d3f8b15c414a3a2b9f914729b9afe0e (patch)
tree6500acb7e1c1c5d9bc2f4bcdae97ad389e761612
parentf81db3c80ee49b0259cb8641630beeca58cb6af4 (diff)
merge revision(s) 49235: [Backport #10711]
numeric.c: fix message * numeric.c (coerce_failed): fix the error message on non-flonum platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--numeric.c9
-rw-r--r--version.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index 7c9aef1e41..ba2fb49b3b 100644
--- a/numeric.c
+++ b/numeric.c
@@ -236,9 +236,14 @@ NORETURN(static void coerce_failed(VALUE x, VALUE y));
static void
coerce_failed(VALUE x, VALUE y)
{
+ if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
+ y = rb_inspect(y);
+ }
+ else {
+ y = rb_obj_class(y);
+ }
rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE,
- (rb_special_const_p(y)? rb_inspect(y) : rb_obj_class(y)),
- rb_obj_class(x));
+ y, rb_obj_class(x));
}
static VALUE
diff --git a/version.h b/version.h
index 2f8239ec96..79821f055c 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.1.7"
#define RUBY_RELEASE_DATE "2015-07-03"
-#define RUBY_PATCHLEVEL 374
+#define RUBY_PATCHLEVEL 375
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 7