ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:72955] [Ruby trunk - Bug #12011] [Open] honor Marshal.load post proc value for TYPE_LINK
       [not found] <redmine.issue-12011.20160120022515@ruby-lang.org>
@ 2016-01-20  2:25 ` naruse
  2016-01-20  2:25 ` [ruby-core:72956] [Ruby trunk - Bug #12011] " naruse
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: naruse @ 2016-01-20  2:25 UTC (permalink / raw
  To: ruby-core

Issue #12011 has been reported by Yui NARUSE.

----------------------------------------
Bug #12011: honor Marshal.load post proc value for TYPE_LINK
https://bugs.ruby-lang.org/issues/12011

* Author: Yui NARUSE
* Status: Open
* 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 --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/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [ruby-core:72956] [Ruby trunk - Bug #12011] honor Marshal.load post proc value for TYPE_LINK
       [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 ` naruse
  2016-01-21  9:03 ` [ruby-core:73018] [Ruby trunk - Bug #12011] [Closed] " naruse
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: naruse @ 2016-01-20  2:25 UTC (permalink / raw
  To: ruby-core

Issue #12011 has been updated by Yui NARUSE.

Description updated

----------------------------------------
Bug #12011: honor Marshal.load post proc value for TYPE_LINK
https://bugs.ruby-lang.org/issues/12011#change-56178

* Author: Yui NARUSE
* Status: Open
* 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/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [ruby-core:73018] [Ruby trunk - Bug #12011] [Closed] honor Marshal.load post proc value for TYPE_LINK
       [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
  2016-02-25 10:26 ` [ruby-core:73981] [Ruby trunk Bug#12011] " usa
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: naruse @ 2016-01-21  9:03 UTC (permalink / raw
  To: ruby-core

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/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [ruby-core:73981] [Ruby trunk Bug#12011] honor Marshal.load post proc value for TYPE_LINK
       [not found] <redmine.issue-12011.20160120022515@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2016-01-21  9:03 ` [ruby-core:73018] [Ruby trunk - Bug #12011] [Closed] " naruse
@ 2016-02-25 10:26 ` usa
  2016-03-09 13:59 ` [ruby-core:74243] " nagachika00
  2016-03-29 15:41 ` [ruby-core:74701] " naruse
  5 siblings, 0 replies; 6+ messages in thread
From: usa @ 2016-02-25 10:26 UTC (permalink / raw
  To: ruby-core

Issue #12011 has been updated by Usaku NAKAMURA.

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.

----------------------------------------
Bug #12011: honor Marshal.load post proc value for TYPE_LINK
https://bugs.ruby-lang.org/issues/12011#change-57135

* Author: Yui NARUSE
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: DONTNEED, 2.1: DONE, 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/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [ruby-core:74243] [Ruby trunk Bug#12011] honor Marshal.load post proc value for TYPE_LINK
       [not found] <redmine.issue-12011.20160120022515@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2016-02-25 10:26 ` [ruby-core:73981] [Ruby trunk Bug#12011] " usa
@ 2016-03-09 13:59 ` nagachika00
  2016-03-29 15:41 ` [ruby-core:74701] " naruse
  5 siblings, 0 replies; 6+ messages in thread
From: nagachika00 @ 2016-03-09 13:59 UTC (permalink / raw
  To: ruby-core

Issue #12011 has been updated by Tomoyuki Chikanaga.

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.

----------------------------------------
Bug #12011: honor Marshal.load post proc value for TYPE_LINK
https://bugs.ruby-lang.org/issues/12011#change-57378

* Author: Yui NARUSE
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE, 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/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [ruby-core:74701] [Ruby trunk Bug#12011] honor Marshal.load post proc value for TYPE_LINK
       [not found] <redmine.issue-12011.20160120022515@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2016-03-09 13:59 ` [ruby-core:74243] " nagachika00
@ 2016-03-29 15:41 ` naruse
  5 siblings, 0 replies; 6+ messages in thread
From: naruse @ 2016-03-29 15:41 UTC (permalink / raw
  To: ruby-core

Issue #12011 has been updated by Yui NARUSE.

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.

----------------------------------------
Bug #12011: honor Marshal.load post proc value for TYPE_LINK
https://bugs.ruby-lang.org/issues/12011#change-57831

* Author: Yui NARUSE
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE, 2.3: DONE
----------------------------------------
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/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-29 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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 ` [ruby-core:73018] [Ruby trunk - Bug #12011] [Closed] " naruse
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

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).