diff options
author | Koichi Sasada <ko1@atdot.net> | 2023-02-10 16:02:20 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2023-02-10 17:55:25 +0900 |
commit | be94808282e50d3ecaa1392ffc38c9ec89e3438b (patch) | |
tree | f1e98d44d7743ce8785ac257282ba8082f831bd5 /proc.c | |
parent | 38ecf08ba16b7e8946ac414f4f8c7ee155b34083 (diff) | |
download | ruby-be94808282e50d3ecaa1392ffc38c9ec89e3438b.tar.gz |
use correct svar even if env is escaped
This patch is follo-up of 0a82bfe.
Without this patch, if env is escaped (Proc'ed), strange svar
can be touched.
This patch tracks escaped env and use it.
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -712,7 +712,8 @@ 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, (VALUE)GET_EC()->cfp); + rb_execution_context_t *ec = GET_EC(); + VALUE ret = rb_imemo_new(imemo_ifunc, (VALUE)func, (VALUE)data, arity.packed, (VALUE)rb_vm_svar_lep(ec, ec->cfp)); return (struct vm_ifunc *)ret; } |