Project

General

Profile

Actions

Bug #12011

closed

honor Marshal.load post proc value for TYPE_LINK

Bug #12011: honor Marshal.load post proc value for TYPE_LINK

Added by naruse (Yui NARUSE) almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:72955]

Description

Following test doesn't work.
A patch also attached.
Both of them are worked by nahi.

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

Updated by naruse (Yui NARUSE) almost 10 years ago Actions #1 [ruby-core:72956]

  • Description updated (diff)

Updated by naruse (Yui NARUSE) almost 10 years ago Actions #2 [ruby-core:73018]

  • Status changed from Open to Closed

Updated by usa (Usaku NAKAMURA) over 9 years ago Actions #3 [ruby-core:73981]

  • Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED

ruby_2_1 r53934 merged revision(s) 53609.

Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago Actions #4 [ruby-core:74243]

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE, 2.3: REQUIRED

Backported into ruby_2_2 branch at r54068.

Updated by naruse (Yui NARUSE) over 9 years ago Actions #5 [ruby-core:74701]

  • Backport changed from 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE, 2.3: DONE

ruby_2_3 r54357 merged revision(s) 53609.

Actions

Also available in: PDF Atom