diff options
author | Yusuke Endoh <[email protected]> | 2019-12-09 15:22:48 +0900 |
---|---|---|
committer | Yusuke Endoh <[email protected]> | 2019-12-09 15:22:48 +0900 |
commit | 156fb72d7015b420c57b0bd230693f52d8d75b32 (patch) | |
tree | 8f4263c1a1a317e95f99419de4481512d2c151aa /compile.c | |
parent | 07664f3aec1b80f6ffe3929258c9a246f0bdcc48 (diff) |
vm_args.c (rb_warn_check): Use iseq_unique_id instead of its pointer
(This is the second try of 036bc1da6c6c9b0fa9b7f5968d897a9554dd770e.)
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 'compile.c')
-rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -10490,7 +10490,7 @@ ibf_load_location_str(const struct ibf_load *load, VALUE str_index) static void ibf_load_iseq_each(struct ibf_load *load, rb_iseq_t *iseq, ibf_offset_t offset) { - struct rb_iseq_constant_body *load_body = iseq->body = ZALLOC(struct rb_iseq_constant_body); + struct rb_iseq_constant_body *load_body = iseq->body = rb_iseq_constant_body_alloc(); ibf_offset_t reading_pos = offset; |