summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-11 17:51:05 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-11 17:51:05 +0000
commit9d4ff5aefc8834ce1a80bc5508181fa88f8db416 (patch)
tree0dbc66a4f2f91ebb55374b053a9bba331f25fb28
parentf1c8f497232d7850d88e24ac54d7dc725c8ca6b0 (diff)
merge revision(s) 57407: [Backport #13145]
object.c: no TypeError at Symbol * object.c (special_object_p): uninterned Symbol also should not raise a TypeError but return itself instead, as well as interned Symbols. [ruby-core:79216] [Bug #13145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--object.c1
-rw-r--r--test/ruby/test_object.rb4
-rw-r--r--version.h2
3 files changed, 6 insertions, 1 deletions
diff --git a/object.c b/object.c
index 5f0055fb5a..98d2197c2d 100644
--- a/object.c
+++ b/object.c
@@ -304,6 +304,7 @@ special_object_p(VALUE obj)
switch (BUILTIN_TYPE(obj)) {
case T_BIGNUM:
case T_FLOAT:
+ case T_SYMBOL:
return TRUE;
default:
return FALSE;
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index c1721de39c..7c1b98f76e 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -23,6 +23,8 @@ class TestObject < Test::Unit::TestCase
assert_equal true, true.dup
assert_equal nil, nil.dup
assert_equal false, false.dup
+ x = :x; assert_equal x, x.dup
+ x = "bug13145".intern; assert_equal x, x.dup
x = 1 << 64; assert_equal x, x.dup
x = 1.72723e-77; assert_equal x, x.dup
@@ -51,6 +53,8 @@ class TestObject < Test::Unit::TestCase
assert_equal true, true.clone
assert_equal nil, nil.clone
assert_equal false, false.clone
+ x = :x; assert_equal x, x.dup
+ x = "bug13145".intern; assert_equal x, x.dup
x = 1 << 64; assert_equal x, x.clone
x = 1.72723e-77; assert_equal x, x.clone
assert_raise(ArgumentError) {1.clone(freeze: false)}
diff --git a/version.h b/version.h
index 56c05cf830..3e752aec8f 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.4.0"
#define RUBY_RELEASE_DATE "2017-03-12"
-#define RUBY_PATCHLEVEL 34
+#define RUBY_PATCHLEVEL 35
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 3