mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
use correct svar (#7225)
* use correct svar Without this patch, svar location is used "nearest Ruby frame". It is almost correct but it doesn't correct when the `each` method is written in Ruby. ```ruby class C include Enumerable def each %w(bar baz).each{|e| yield e} end end C.new.grep(/(b.)/){|e| p [$1, e]} ``` This patch fix this issue by traversing ifunc's cfp. Note that if cfp doesn't specify this Thread's cfp stack, reserved svar location (`ec->root_svar`) is used. * make yjit-bindgen --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
This commit is contained in:
parent
2675f2c864
commit
0a82bfe5e1
Notes:
git
2023-02-02 00:13:40 +00:00
Merged-By: k0kubun <takashikkbn@gmail.com>
4 changed files with 21 additions and 8 deletions
2
proc.c
2
proc.c
|
@ -752,7 +752,7 @@ rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int m
|
|||
}
|
||||
arity.argc.min = min_argc;
|
||||
arity.argc.max = max_argc;
|
||||
VALUE ret = rb_imemo_new(imemo_ifunc, (VALUE)func, (VALUE)data, arity.packed, 0);
|
||||
VALUE ret = rb_imemo_new(imemo_ifunc, (VALUE)func, (VALUE)data, arity.packed, (VALUE)GET_EC()->cfp);
|
||||
return (struct vm_ifunc *)ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue