Project

General

Profile

Bug #14335

block.call should respect redefinition of Proc#call

Added by ktsj (Kazuki Tsujimoto) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 2.6.0dev (2018-01-08 master 61663) [x86_64-linux]
[ruby-dev:50414]

Description

r61659の変更によって、
ブロック引数に対してcallメソッドを呼び出したときに
Proc#callの再定義が無視されるようになっています。

$ cat t.rb
Proc.prepend Module.new {
  def call
    p :call
    super
  end
}

def m(&blk)
  yield
  blk.call
end

m {}

$ ruby -v t.rb
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
:call

$ ./ruby -v t.rb
ruby 2.6.0dev (2018-01-08 master 61663) [x86_64-linux]

Related issues

Related to Ruby trunk - Feature #14330: Speedup `block.call` where `block` is passed block parameter.ClosedActions

Associated revisions

Revision 0948eb62
Added by nobu (Nobuyoshi Nakada) over 1 year ago

vm.c: respect redefinition of Proc#call

  • vm.c (vm_redefinition_check_method_type): hoist out method
    definition type to check redefinition.

  • vm.c (rb_vm_check_redefinition_opt_method): should check
    optimized method too.

  • vm.c (vm_init_redefined_flag): check Proc#call.

  • vm_insnhelper.c (vm_call_opt_block_call): search proper method
    if redefined. [Bug #14335]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 61680
Added by nobu (Nobuyoshi Nakada) over 1 year ago

vm.c: respect redefinition of Proc#call

  • vm.c (vm_redefinition_check_method_type): hoist out method
    definition type to check redefinition.

  • vm.c (rb_vm_check_redefinition_opt_method): should check
    optimized method too.

  • vm.c (vm_init_redefined_flag): check Proc#call.

  • vm_insnhelper.c (vm_call_opt_block_call): search proper method
    if redefined. [Bug #14335]

Revision 61680
Added by nobu (Nobuyoshi Nakada) over 1 year ago

vm.c: respect redefinition of Proc#call

  • vm.c (vm_redefinition_check_method_type): hoist out method
    definition type to check redefinition.

  • vm.c (rb_vm_check_redefinition_opt_method): should check
    optimized method too.

  • vm.c (vm_init_redefined_flag): check Proc#call.

  • vm_insnhelper.c (vm_call_opt_block_call): search proper method
    if redefined. [Bug #14335]

History

#1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Related to Feature #14330: Speedup `block.call` where `block` is passed block parameter. added
#2

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r61680.


vm.c: respect redefinition of Proc#call

  • vm.c (vm_redefinition_check_method_type): hoist out method
    definition type to check redefinition.

  • vm.c (rb_vm_check_redefinition_opt_method): should check
    optimized method too.

  • vm.c (vm_init_redefined_flag): check Proc#call.

  • vm_insnhelper.c (vm_call_opt_block_call): search proper method
    if redefined. [Bug #14335]

Also available in: Atom PDF