From b02bd63dc5cd4918230fed3344bc71e2e5540087 Mon Sep 17 00:00:00 2001 From: dearblue Date: Mon, 22 Nov 2021 21:39:39 +0900 Subject: Fixed occurs `SIGSEGV` with `mrbgems/mruby-method` Calling the `Method#{parameters,source_location}` method on a static `Proc` object resulted in `SIGSEGV`. The trigger is https://github.com/mruby/mruby/pull/5402. The original implementation of the `Method#{parameters,source_location}` method was to temporarily rewrite the object and then call the method of the same name in `Proc`. Rewriting of objects placed in the ROM section by #5402 above is prohibited by hardware such as the CPU. This caused a `SIGSEGV`. --- mrbgems/mruby-proc-ext/src/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mrbgems/mruby-proc-ext/src') diff --git a/mrbgems/mruby-proc-ext/src/proc.c b/mrbgems/mruby-proc-ext/src/proc.c index 9d8a7b037..ac89db193 100644 --- a/mrbgems/mruby-proc-ext/src/proc.c +++ b/mrbgems/mruby-proc-ext/src/proc.c @@ -92,7 +92,7 @@ mrb_kernel_proc(mrb_state *mrb, mrb_value self) * prc.parameters #=> [[:req, :x], [:opt, :y], [:rest, :other]] */ -static mrb_value +mrb_value mrb_proc_parameters(mrb_state *mrb, mrb_value self) { struct parameters_type { -- cgit v1.2.3