Skip to content

Commit 4bd6973

Browse files
committed
add tag v2_3_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_3_4@58214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2 parents 87f09a8 + 0ad1685 commit 4bd6973

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Wed Mar 29 23:47:31 2017 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
2+
3+
* hash.c (any_hash): fix CI failure on L32LLP64 architecture.
4+
The patch was provided by usa. [ruby-core:80484] [Bug #13376]
5+
6+
Wed Mar 29 06:22:27 2017 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
7+
8+
* hash.c (any_hash): fix Symbol#hash to be nondeterministic.
9+
The patch was provided by Eric Wong. [ruby-core:80433] [Bug #13376]
10+
11+
* test/ruby/test_symbol.rb: add test for above.
12+
113
Tue Mar 28 00:38:39 2017 NAKAMURA Usaku <usa@ruby-lang.org>
214

315
* win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets

hash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
139139
if (a == Qundef) return 0;
140140
if (STATIC_SYM_P(a)) {
141141
hnum = a >> (RUBY_SPECIAL_SHIFT + ID_SCOPE_SHIFT);
142+
hnum = rb_hash_start(hnum);
142143
goto out;
143144
}
144145
else if (FLONUM_P(a)) {
@@ -167,7 +168,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
167168
}
168169
out:
169170
hnum <<= 1;
170-
return (st_index_t)RSHIFT(hnum, 1);
171+
return (long)RSHIFT(hnum, 1);
171172
}
172173

173174
static st_index_t

test/ruby/test_symbol.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,4 +411,14 @@ def test_not_freeze
411411
assert_equal str, str.to_sym.to_s
412412
assert_not_predicate(str, :frozen?, bug11721)
413413
end
414+
415+
def test_hash_nondeterministic
416+
ruby = EnvUtil.rubybin
417+
refute_equal `#{ruby} -e 'puts :foo.hash'`, `#{ruby} -e 'puts :foo.hash'`,
418+
'[ruby-core:80430] [Bug #13376]'
419+
420+
sym = "dynsym_#{Random.rand(10000)}_#{Time.now}"
421+
refute_equal `#{ruby} -e 'puts #{sym.inspect}.to_sym.hash'`,
422+
`#{ruby} -e 'puts #{sym.inspect}.to_sym.hash'`
423+
end
414424
end

version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#define RUBY_VERSION "2.3.4"
2-
#define RUBY_RELEASE_DATE "2017-03-28"
3-
#define RUBY_PATCHLEVEL 299
2+
#define RUBY_RELEASE_DATE "2017-03-30"
3+
#define RUBY_PATCHLEVEL 301
44

55
#define RUBY_RELEASE_YEAR 2017
66
#define RUBY_RELEASE_MONTH 3
7-
#define RUBY_RELEASE_DAY 28
7+
#define RUBY_RELEASE_DAY 30
88

99
#include "ruby/version.h"
1010

0 commit comments

Comments
 (0)