[#51116] [Ruby master Bug#18383] When I access to localhost:3000, got "Don't forget to include the Crash Report log file under DiagnosticReports directory in bug reports" — "yuuyake9191 (Daime Tatsuru)" <noreply@...>

Issue #18383 has been reported by yuuyake9191 (Daime Tatsuru).

10 messages 2021/12/03

[ruby-dev:51127] [Ruby master Bug#14817] TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters

From: "ko1 (Koichi Sasada)" <noreply@...>
Date: 2021-12-14 17:15:32 UTC
List: ruby-dev #51127
Issue #14817 has been updated by ko1 (Koichi Sasada).

Status changed from Assigned to Closed

fixed https://github.com/ruby/ruby/pull/4637

----------------------------------------
Bug #14817: TracePoint#parameters for bmethod's return event should return the same value as its Method#parameters
https://bugs.ruby-lang.org/issues/14817#change-95346

* Author: ktsj (Kazuki Tsujimoto)
* Status: Closed
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* ruby -v: ruby 2.6.0dev (2018-06-03 master 63562) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
define_methodしたメソッド(bmethod)のcall/returnイベント中にTracePoint#parametersを呼び出すと
以下の結果となります。

```
$ cat t.rb
define_method(:bm) {|a|}

p method_parameters: method(:bm).parameters

trace = TracePoint.new(:call, :return){|tp|
  mid = tp.method_id
  if mid == :bm
    p mid: mid, event: tp.event, tp_parameters: tp.parameters
  end
}
trace.enable{
  bm(0)
}

$ ruby -v t.rb
ruby 2.6.0dev (2018-06-03 master 63562) [x86_64-linux]
{:method_parameters=>[[:req, :a]]}
{:mid=>:bm, :event=>:call, :tp_parameters=>[[:req, :a]]}
{:mid=>:bm, :event=>:return, :tp_parameters=>[]}         #=> expected: {:mid=>:bm, :event=>:return, :tp_parameters=>[[:req, :a]]}
```

現状、callイベントに限ってその戻り値がbmethodのMethod#parametersの呼び出し結果と一致しますが
returnイベント時も同様となるべきだと思います。




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next