summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-29 16:44:59 (GMT)
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-29 16:44:59 (GMT)
commit4bd69735af901266ec21486243fc206030caa6b9 (patch)
treec6f82a3fd04a6389cfe25cfaa9fb949568e094cd
parent87f09a8a0deccdac16935dc61c6efa35b014ff8e (diff)
parent0ad168551355320c091045c0bb6d4b51798bbcc0 (diff)
add tag v2_3_4v2_3_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_3_4@58214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog12
-rw-r--r--hash.c3
-rw-r--r--test/ruby/test_symbol.rb10
-rw-r--r--version.h6
4 files changed, 27 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 16e65f8..593cdc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Wed Mar 29 23:47:31 2017 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * hash.c (any_hash): fix CI failure on L32LLP64 architecture.
+ The patch was provided by usa. [ruby-core:80484] [Bug #13376]
+
+Wed Mar 29 06:22:27 2017 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
+
+ * hash.c (any_hash): fix Symbol#hash to be nondeterministic.
+ The patch was provided by Eric Wong. [ruby-core:80433] [Bug #13376]
+
+ * test/ruby/test_symbol.rb: add test for above.
+
Tue Mar 28 00:38:39 2017 NAKAMURA Usaku <usa@ruby-lang.org>
* win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets
diff --git a/hash.c b/hash.c
index 58a3d04..e418b99 100644
--- a/hash.c
+++ b/hash.c
@@ -139,6 +139,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
if (a == Qundef) return 0;
if (STATIC_SYM_P(a)) {
hnum = a >> (RUBY_SPECIAL_SHIFT + ID_SCOPE_SHIFT);
+ hnum = rb_hash_start(hnum);
goto out;
}
else if (FLONUM_P(a)) {
@@ -167,7 +168,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
}
out:
hnum <<= 1;
- return (st_index_t)RSHIFT(hnum, 1);
+ return (long)RSHIFT(hnum, 1);
}
static st_index_t
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index ce3b0d6..34cd886 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -411,4 +411,14 @@ class TestSymbol < Test::Unit::TestCase
assert_equal str, str.to_sym.to_s
assert_not_predicate(str, :frozen?, bug11721)
end
+
+ def test_hash_nondeterministic
+ ruby = EnvUtil.rubybin
+ refute_equal `#{ruby} -e 'puts :foo.hash'`, `#{ruby} -e 'puts :foo.hash'`,
+ '[ruby-core:80430] [Bug #13376]'
+
+ sym = "dynsym_#{Random.rand(10000)}_#{Time.now}"
+ refute_equal `#{ruby} -e 'puts #{sym.inspect}.to_sym.hash'`,
+ `#{ruby} -e 'puts #{sym.inspect}.to_sym.hash'`
+ end
end
diff --git a/version.h b/version.h
index 29116f9..17b906b 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.3.4"
-#define RUBY_RELEASE_DATE "2017-03-28"
-#define RUBY_PATCHLEVEL 299
+#define RUBY_RELEASE_DATE "2017-03-30"
+#define RUBY_PATCHLEVEL 301
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 28
+#define RUBY_RELEASE_DAY 30
#include "ruby/version.h"