diff options
author | Yusuke Endoh <[email protected]> | 2019-12-09 12:04:58 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2019-12-09 12:04:58 +0900 |
commit | 036bc1da6c6c9b0fa9b7f5968d897a9554dd770e (patch) | |
tree | eb321ed8828e90c830ad63af826400b9bd87c6e0 /vm_core.h | |
parent | 0e71fbc18e97007ac9a9b242b800f34057f5f287 (diff) |
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.
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -447,6 +447,8 @@ struct rb_iseq_constant_body { long unsigned total_calls; /* number of total calls with `mjit_exec()` */ struct rb_mjit_unit *jit_unit; #endif + + unsigned long iseq_unique_id; /* -- Remove In 3.0 -- */ }; /* T_IMEMO/iseq */ |