summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-25 10:27:07 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-25 10:27:07 +0000
commitca8b2d26f03b5bb5e71a0de6bab1580b6326fe14 (patch)
tree247305d6c4da35c3efbc16120ffdcff258d39286
parent63b34adea2eb7af969f7523d34a72427b8b8dbde (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_1@53934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--marshal.c2
-rw-r--r--test/ruby/test_marshal.rb6
-rw-r--r--version.h2
4 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8174289ac9..2a53127360 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Feb 25 19:25:25 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 Feb 25 18:59:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/socket/option.c (sockopt_bool): relax boolean size to be one
diff --git a/marshal.c b/marshal.c
index 9aba5e3204..fd6e12f0d9 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1499,7 +1499,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 967aa37723..14c49faca3 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -606,4 +606,10 @@ class TestMarshal < Test::Unit::TestCase
Marshal.dump(TestForRespondToFalse.new)
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
diff --git a/version.h b/version.h
index e8b8d7310a..14945bf5df 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.1.9"
#define RUBY_RELEASE_DATE "2016-02-25"
-#define RUBY_PATCHLEVEL 452
+#define RUBY_PATCHLEVEL 453
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 2