[ruby-cvs:72736] ko1:r65636 (trunk): fix passing wrong `passed_bmethod_me`.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Fri Nov 9 10:02:13 JST 2018


ko1	2018-11-09 10:02:13 +0900 (Fri, 09 Nov 2018)

  New Revision: 65636

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65636

  Log:
    fix passing wrong `passed_bmethod_me`.
    
    * vm_core.h: remove `rb_execution_context_t::passed_bmethod_me`
      and fix functions to pass the `me` directly.
      `passed_bmethod_me` was used to make bmethod (methods defined by
      `defined_method`). `rb_vm_invoke_bmethod` invoke `Proc` with `me`
      information as method frame (`lambda` frame, actually).
      If the proc call is not bmethod call, `passed_bmethod_me` should
      be NULL. However, there is a bug which passes wrong `me` for
      normal block call.
    
      http://ci.rvm.jp/results/trunk-asserts@silicon-docker/1449470
    
      This is because wrong `me` was remained in `passed_bmethod_me`
      (and used incorrectly it after collected by GC).
    
      We need to clear `passed_bmethod_me` just after bmethod call,
      but clearing is not enough.
    
      To solve this issue, I removed `passed_bmethod_me` and pass `me`
      information as a function parameter of `rb_vm_invoke_bmethod`,
      `invoke_block_from_c_proc` and `invoke_iseq_block_from_c` in vm.c.
    
    * vm.c (invoke_iseq_block_from_c): the number of parameters is too
      long so that I try to specify `ALWAYS_INLINE`.
    
    * vm.c (invoke_block_from_c_proc): ditto.
    
    * vm_insnhelper.c (vm_yield_with_cfunc): now there are no pathes
      to use bmethod here.

  Modified files:
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_insnhelper.c


More information about the ruby-cvs mailing list