[ruby-cvs:78548] 036bc1da6c (master): vm_args.c (rb_warn_check): Use iseq_unique_id instead of its pointer

"Yusuke Endoh" <[email protected]>
Newsgroups gmane.comp.lang.ruby.cvs
Message-ID <[email protected]>
Yusuke Endoh	2019-12-09 12:04:58 +0900 (Mon, 09 Dec 2019)

  New Revision: 036bc1da6c

  https://github.com/ruby/ruby/commit/036bc1da6c

  Log:
    vm_args.c (rb_warn_check): Use iseq_unique_id instead of its pointer
    
    If iseq is GC'ed, the pointer of iseq may be reused, which may hide a
    deprecation warning of keyword argument change.
    
    http://ci.rvm.jp/results/trunk-test1@phosphorus-docker/2474221
    
    ```
      1) Failure:
    TestKeywordArguments#test_explicit_super_kwsplat [/tmp/ruby/v2/src/trunk-test1/test/ruby/test_keyword.rb:549]:
    --- expected
    +++ actual
    @@ -1 +1 @@
    -/The keyword argument is passed as the last hash parameter.* for `m'/m
    +""
    ```
    
    This change ad-hocly adds iseq_unique_id for each iseq, and use it
    instead of iseq pointer.  This covers the case where caller is GC'ed.
    Still, the case where callee is GC'ed, is not covered.
    
    But anyway, it is very rare that iseq is GC'ed.  Even when it occurs, it
    just hides some warnings.  It's no big deal.

  Modified files:
    iseq.c
    vm_args.c
    vm_core.h
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.