diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-09 13:58:39 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-09 13:58:39 +0000 |
commit | 6aad84e00ba4a9eb624fce2d985b9a34feb0e0a7 (patch) | |
tree | e2e79bb1bd5b05f33a0bd91f7a0a8349c4112750 | |
parent | 7d25771f17e2eb1db2067138ff27601ea6ab6986 (diff) |
merge revision(s) 53609: [Backport #12011]
* marshal.c (r_object0): honor Marshal.load post proc
value for TYPE_LINK. by Hiroshi Nakamura <nahi@ruby-lang.org>
https://github.com/ruby/ruby/pull/1204 fix GH-1204
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | marshal.c | 2 | ||||
-rw-r--r-- | test/ruby/test_marshal.rb | 6 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Wed Mar 9 22:46:56 2016 NARUSE, Yui <naruse@ruby-lang.org> + + * marshal.c (r_object0): honor Marshal.load post proc + value for TYPE_LINK. by Hiroshi Nakamura <nahi@ruby-lang.org> + https://github.com/ruby/ruby/pull/1204 fix GH-1204 + Wed Mar 9 22:26:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/socket/option.c (sockopt_bool): relax boolean size to be one @@ -1566,7 +1566,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) rb_raise(rb_eArgError, "dump format error (unlinked)"); } v = (VALUE)link; - r_post_proc(v, arg); + v = r_post_proc(v, arg); break; case TYPE_IVAR: diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 3d5d6c9b1f..8c08280c65 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -647,4 +647,10 @@ class TestMarshal < Test::Unit::TestCase c.cc.call end end + + def test_marshal_honor_post_proc_value_for_link + str = 'x' # for link + obj = [str, str] + assert_equal(['X', 'X'], Marshal.load(Marshal.dump(obj), ->(v) { v == str ? v.upcase : v })) + end end @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.2.5" #define RUBY_RELEASE_DATE "2016-03-09" -#define RUBY_PATCHLEVEL 251 +#define RUBY_PATCHLEVEL 252 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 3 |