File tree Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change
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
+
1
13
Tue Mar 28 00:38:39 2017 NAKAMURA Usaku <usa@ruby-lang.org>
2
14
3
15
* win32/win32.c (poll_child_status): rb_w32_wait_events_blocking() sets
Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
139
139
if (a == Qundef ) return 0 ;
140
140
if (STATIC_SYM_P (a )) {
141
141
hnum = a >> (RUBY_SPECIAL_SHIFT + ID_SCOPE_SHIFT );
142
+ hnum = rb_hash_start (hnum );
142
143
goto out ;
143
144
}
144
145
else if (FLONUM_P (a )) {
@@ -167,7 +168,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
167
168
}
168
169
out :
169
170
hnum <<= 1 ;
170
- return (st_index_t )RSHIFT (hnum , 1 );
171
+ return (long )RSHIFT (hnum , 1 );
171
172
}
172
173
173
174
static st_index_t
Original file line number Diff line number Diff line change @@ -411,4 +411,14 @@ def test_not_freeze
411
411
assert_equal str , str . to_sym . to_s
412
412
assert_not_predicate ( str , :frozen? , bug11721 )
413
413
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
414
424
end
Original file line number Diff line number Diff line change 1
1
#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
4
4
5
5
#define RUBY_RELEASE_YEAR 2017
6
6
#define RUBY_RELEASE_MONTH 3
7
- #define RUBY_RELEASE_DAY 28
7
+ #define RUBY_RELEASE_DAY 30
8
8
9
9
#include "ruby/version.h"
10
10
You can’t perform that action at this time.
0 commit comments