From: "mame (Yusuke Endoh)" Date: 2012-10-31T22:03:08+09:00 Subject: [ruby-core:48670] [ruby-trunk - Bug #5519][Rejected] Enumerator#next skips c-return hooks Issue #5519 has been updated by mame (Yusuke Endoh). Status changed from Feedback to Rejected kernigh is right; this is a spec. Closing. -- Yusuke Endoh ---------------------------------------- Bug #5519: Enumerator#next skips c-return hooks https://bugs.ruby-lang.org/issues/5519#change-32109 Author: YenTheFirst (T S) Status: Rejected Priority: Normal Assignee: Category: Target version: 1.9.2 ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux] In some cases, especially using #next, c-calls are traced, but corresponding c-returns are not. tracing this snippet: a=[1,2,3,4].to_enum b=a.next produces this output: c-return test4.rb:3 set_trace_func Kernel line test4.rb:4 c-call test4.rb:4 to_enum Kernel c-return test4.rb:4 to_enum Kernel line test4.rb:5 c-call test4.rb:5 next Enumerator c-call test4.rb:5 proc Kernel c-return test4.rb:5 proc Kernel c-call :0 each Enumerator c-call :0 each Array c-return test4.rb:5 next Enumerator Enumerator#each and Array#each are c-called, but the next return jumps back up to Enumerator#next. I get the same result on 1.9.2-p290, 1.9.2-head(r32926), and 1.9.3-head(r33569) -- http://bugs.ruby-lang.org/