* 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/trunk@53609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
89ee8a557e
commit
826f2ee306
@ -1,3 +1,9 @@
|
||||
Thu Jan 21 17:34:01 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
|
||||
|
||||
Thu Jan 21 16:37:50 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* Makefile.in (update-rubyspec): fix r53208 like r53451.
|
||||
|
@ -1569,7 +1569,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:
|
||||
|
@ -712,4 +712,10 @@ class TestMarshal < Test::Unit::TestCase
|
||||
assert_predicate(status, :success?)
|
||||
assert_equal(expected, out)
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user