From: naruse@airemix.jp
To: ruby-core@ruby-lang.org
Subject: [ruby-core:73018] [Ruby trunk - Bug #12011] [Closed] honor Marshal.load post proc value for TYPE_LINK
Date: Thu, 21 Jan 2016 09:03:47 +0000 [thread overview]
Message-ID: <redmine.journal-56241.20160121090346.67de8814052e59d8@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-12011.20160120022515@ruby-lang.org
Issue #12011 has been updated by Yui NARUSE.
Status changed from Open to Closed
----------------------------------------
Bug #12011: honor Marshal.load post proc value for TYPE_LINK
https://bugs.ruby-lang.org/issues/12011#change-56241
* Author: Yui NARUSE
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v:
* Backport: 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
----------------------------------------
Following test doesn't work.
A patch also attached.
Both of them are worked by nahi.
```diff
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 482637f..262e7f6 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -712,4 +712,10 @@ def test_no_internal_ids
assert_predicate(status, :success?)
assert_equal(expected, out)
end
+
+ def test_marshal_post_proc
+ 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/marshal.c b/marshal.c
index d67ce87..d64e5ff 100644
--- a/marshal.c
+++ b/marshal.c
@@ -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:
```
https://github.com/ruby/ruby/pull/1204
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2016-01-21 8:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-12011.20160120022515@ruby-lang.org>
2016-01-20 2:25 ` [ruby-core:72955] [Ruby trunk - Bug #12011] [Open] honor Marshal.load post proc value for TYPE_LINK naruse
2016-01-20 2:25 ` [ruby-core:72956] [Ruby trunk - Bug #12011] " naruse
2016-01-21 9:03 ` naruse [this message]
2016-02-25 10:26 ` [ruby-core:73981] [Ruby trunk Bug#12011] " usa
2016-03-09 13:59 ` [ruby-core:74243] " nagachika00
2016-03-29 15:41 ` [ruby-core:74701] " naruse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-56241.20160121090346.67de8814052e59d8@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).