https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112013-06-16T03:29:19ZRuby Issue Tracking SystemBackport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=399592013-06-16T03:29:19Zktsj (Kazuki Tsujimoto)kazuki@callcc.net
<ul><li><strong>File</strong> <a href="/attachments/3748">8341.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3748/8341.patch">8341.patch</a> added</li><li><strong>Assignee</strong> set to <i>ko1 (Koichi Sasada)</i></li></ul><p><code>bmcall'(ifunc) should use a block set by </code>vm_yield_with_cfunc' instead of PASSED_BLOCK.<br>
I attached a patch.</p> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=399782013-06-17T09:59:54Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Assignee</strong> changed from <i>ko1 (Koichi Sasada)</i> to <i>ktsj (Kazuki Tsujimoto)</i></li></ul><p>LTGM</p> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=399792013-06-17T10:00:06Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=399802013-06-17T10:01:09Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r41342.<br>
Joshua, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>test/ruby/test_proc.rb: tests for [Bug <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: block_given? (and the actual block) persist between calls to a proc created from a method (using ... (Closed)" href="https://bugs.ruby-lang.org/issues/8341">#8341</a>]</p> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=399822013-06-17T10:24:08Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li><li><strong>% Done</strong> changed from <i>100</i> to <i>0</i></li><li><strong>Backport</strong> changed from <i>1.9.3: UNKNOWN, 2.0.0: UNKNOWN</i> to <i>1.9.3: REQUIRED, 2.0.0: REQUIRED</i></li></ul> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=399992013-06-17T21:38:55Zktsj (Kazuki Tsujimoto)kazuki@callcc.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r41359.<br>
Joshua, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>
<p>include/ruby/intern.h, proc.c (rb_method_call_with_block):<br>
new function to invoke a Method object with a block passed<br>
as an argument.</p>
</li>
<li>
<p>proc.c (bmcall): use the above function to avoid a block sharing.<br>
<a href="/issues/8341">[ruby-core:54626]</a> [Bug <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: block_given? (and the actual block) persist between calls to a proc created from a method (using ... (Closed)" href="https://bugs.ruby-lang.org/issues/8341">#8341</a>]</p>
</li>
<li>
<p>test/ruby/test_proc.rb (TestProc#test_block_persist_between_calls):<br>
run related tests.</p>
</li>
</ul> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=400012013-06-17T21:50:16Zktsj (Kazuki Tsujimoto)kazuki@callcc.net
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Backport</i></li><li><strong>Project</strong> changed from <i>Ruby master</i> to <i>Backport200</i></li><li><strong>Category</strong> deleted (<del><i>core</i></del>)</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>ktsj (Kazuki Tsujimoto)</i> to <i>nagachika (Tomoyuki Chikanaga)</i></li></ul><p>Please backport r41342, r41359.</p> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=400042013-06-17T22:30:12Zktsj (Kazuki Tsujimoto)kazuki@callcc.net
<ul></ul><p>Oops, r41361 is also needed.</p> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=400402013-06-19T03:22:23Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>This issue was solved with changeset r41392.<br>
Joshua, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>merge revision(s) 41342,41359,41361: [Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: block_given? (and the actual block) persist between calls to a proc created from a method (using ... (Closed)" href="https://bugs.ruby-lang.org/issues/8341">#8341</a>]</p>
<pre><code>test/ruby/test_proc.rb: tests for [Bug #8341]
* include/ruby/intern.h, proc.c (rb_method_call_with_block):
new function to invoke a Method object with a block passed
as an argument.
* proc.c (bmcall): use the above function to avoid a block sharing.
<a href="/issues/8341">[ruby-core:54626]</a> [Bug #8341]
* test/ruby/test_proc.rb (TestProc#test_block_persist_between_calls):
run related tests.
* test/ruby/test_proc.rb (TestProc#test_block_given_method_to_proc):
run test for r41359.
</code></pre> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=400412013-06-19T03:22:50Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Project</strong> changed from <i>Backport200</i> to <i>Backport193</i></li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>nagachika (Tomoyuki Chikanaga)</i> to <i>usa (Usaku NAKAMURA)</i></li></ul> Backport193 - Backport #8341: block_given? (and the actual block) persist between calls to a proc created from a method (using method().to_proc()).https://bugs.ruby-lang.org/issues/8341?journal_id=401542013-06-26T16:55:16Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>This issue was solved with changeset r41650.<br>
Joshua, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>merge revision(s) 41342,41359,41361: [Backport <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: block_given? (and the actual block) persist between calls to a proc created from a method (using ... (Closed)" href="https://bugs.ruby-lang.org/issues/8341">#8341</a>]</p>
<pre><code>test/ruby/test_proc.rb: tests for [Bug #8341]
* include/ruby/intern.h, proc.c (rb_method_call_with_block):
new function to invoke a Method object with a block passed
as an argument.
* proc.c (bmcall): use the above function to avoid a block sharing.
<a href="/issues/8341">[ruby-core:54626]</a> [Bug #8341]
* test/ruby/test_proc.rb (TestProc#test_block_persist_between_calls):
run related tests.
* test/ruby/test_proc.rb (TestProc#test_block_given_method_to_proc):
run test for r41359.
</code></pre>