Project

General

Profile

Actions

Bug #8622

closed

Tracepoint API: B_RETURN_EVENT not triggered when "return" used inside lambda

Added by deivid (David Rodríguez) almost 11 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]
[ruby-core:55924]

Description

=begin

I'm using the Tracepoint API in my gem and I noticed that when the keyword return is used inside a lambda, a block return event (B_RETURN_EVENT) is not triggered. For example, I would expect the same number of B_CALL_EVENT and B_RETURN_EVENT in the piece of code

TracePoint.new(:b_call, :b_return) do |tp|
  warn tp.event
end.enable

a = lambda { return "hola" }.call

# Output:
# b_call
# 
# Expected Output:
# b_call
# b_return 

This seems very similar to issue #8489, so hopefully the fix would be as simple as that one.

Thanks a lot.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0