mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Safely retrieve self from proc in mrb_yield()
Passing a proc generated by the following method to `mrb_yield()` or `mrb_yield_argv()` no longer causes `SIGSEGV`: - C functions made into proc objects with `mrb_proc_new_cfunc()`. - A proc object which is the top level of a program generated by `mrb_load_string_cxt()` etc. with `mrbc_context::no_exec` enabled. See also: #5932
This commit is contained in:
@@ -117,6 +117,7 @@ struct REnv *mrb_env_new(mrb_state *mrb, struct mrb_context *c, mrb_callinfo *ci
|
||||
void mrb_proc_merge_lvar(mrb_state *mrb, mrb_irep *irep, struct REnv *env, int num, const mrb_sym *lv, const mrb_value *stack);
|
||||
mrb_value mrb_proc_local_variables(mrb_state *mrb, const struct RProc *proc);
|
||||
const struct RProc *mrb_proc_get_caller(mrb_state *mrb, struct REnv **env);
|
||||
mrb_value mrb_proc_get_self(mrb_state *mrb, struct RProc *p, struct RClass **target_class_p);
|
||||
#endif
|
||||
|
||||
/* range */
|
||||
|
||||
Reference in New Issue
Block a user