diff options
author | Koichi Sasada <ko1@atdot.net> | 2023-02-02 09:13:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-01 16:13:19 -0800 |
commit | 0a82bfe5e18ac86da72c27389db6eb8da156a0b5 (patch) | |
tree | d5cd6e0a79fa3e600b4d96ebbce3e3d957497c25 /yjit/src/cruby_bindings.inc.rs | |
parent | 2675f2c864f462dbdee85d2187e0ac3379106eed (diff) | |
download | ruby-0a82bfe5e18ac86da72c27389db6eb8da156a0b5.tar.gz |
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>
Diffstat (limited to 'yjit/src/cruby_bindings.inc.rs')
-rw-r--r-- | yjit/src/cruby_bindings.inc.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yjit/src/cruby_bindings.inc.rs b/yjit/src/cruby_bindings.inc.rs index ea57ea67fd..128b249e3b 100644 --- a/yjit/src/cruby_bindings.inc.rs +++ b/yjit/src/cruby_bindings.inc.rs @@ -570,7 +570,7 @@ pub struct vm_ifunc_argc { #[repr(C)] pub struct vm_ifunc { pub flags: VALUE, - pub reserved: VALUE, + pub owner_cfp: *mut rb_control_frame_struct, pub func: rb_block_call_func_t, pub data: *const ::std::os::raw::c_void, pub argc: vm_ifunc_argc, |