https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112017-03-29T09:52:20ZRuby Issue Tracking SystemRuby master - Bug #13369: TracePoint gives incorrect `return_value` after rescuing error when using `return`https://bugs.ruby-lang.org/issues/13369?journal_id=639682017-03-29T09:52:20Zayemos (Yuichiro Someya)
<ul><li><strong>File</strong> <a href="/attachments/6463">diff.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/6463/diff.patch">diff.patch</a> added</li></ul><p>By some investigations, it turned out to be caused by the result value passed in <code>hook_before_rewind</code> method .</p>
<p>The return value would be as expected by the batch, but it would fail in some tests.</p> Ruby master - Bug #13369: TracePoint gives incorrect `return_value` after rescuing error when using `return`https://bugs.ruby-lang.org/issues/13369?journal_id=640902017-04-06T02:56:29Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r58262.</p>
<hr>
<p>fix TracePoint#return_value with non-local exits</p>
<ul>
<li>
<p>vm.c: get return_value from imemo_throw_data object (THROW_DATA_VAL()).<br>
imemo_throw_data (TAG_BREAK) contains returned value.<br>
However, imemo_throw_data (TAG_BREAK) can skip several frames so that<br>
we need to use it only once (at most internal frame). To record it,<br>
we introduced THROW_DATA_CONSUMED and check it.</p>
</li>
<li>
<p>internal.h: define THROW_DATA_CONSUMED flag.</p>
</li>
<li>
<p>test/ruby/test_settracefunc.rb: add tests for [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: TracePoint gives incorrect `return_value` after rescuing error when using `return` (Closed)" href="https://bugs.ruby-lang.org/issues/13369">#13369</a>]</p>
</li>
<li>
<p>vm_insnhelper.h: add THROW_DATA_CONSUMED_P() and<br>
THROW_DATA_CONSUMED_SET().</p>
</li>
</ul> Ruby master - Bug #13369: TracePoint gives incorrect `return_value` after rescuing error when using `return`https://bugs.ruby-lang.org/issues/13369?journal_id=657032017-07-09T19:41:04Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN</i> to <i>2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED</i></li></ul> Ruby master - Bug #13369: TracePoint gives incorrect `return_value` after rescuing error when using `return`https://bugs.ruby-lang.org/issues/13369?journal_id=657042017-07-09T19:47:33Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: REQUIRED</i> to <i>2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: DONE</i></li></ul><p>ruby_2_4 r59296 merged revision(s) 58262,5826.</p> Ruby master - Bug #13369: TracePoint gives incorrect `return_value` after rescuing error when using `return`https://bugs.ruby-lang.org/issues/13369?journal_id=660572017-08-08T11:26:56Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: DONE</i> to <i>2.2: WONTFIX, 2.3: REQUIRED, 2.4: DONE</i></li></ul> Ruby master - Bug #13369: TracePoint gives incorrect `return_value` after rescuing error when using `return`https://bugs.ruby-lang.org/issues/13369?journal_id=660982017-08-09T10:44:01Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>2.2: WONTFIX, 2.3: REQUIRED, 2.4: DONE</i> to <i>2.2: WONTFIX, 2.3: DONE, 2.4: DONE</i></li></ul><p>ruby_2_3 r59547 merged revision(s) 58262,58263.</p>