summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2025-06-18 13:18:22 -0700
committerJohn Hawthorn <john@hawthorn.email>2026-05-03 20:19:58 -0700
commitbd16973b85a8c3ea9e2878e23b204d05e4c67609 (patch)
tree768b7c1b61866973be3c0a29843f522ccb9c4b14 /proc.c
parentf617eff63e10b65566042f20b4a76d4f392d131b (diff)
Use write barrier version for rb_proc_call_kw
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index 99fb880881..c93ba2b636 100644
--- a/proc.c
+++ b/proc.c
@@ -1132,7 +1132,12 @@ rb_proc_call_kw(VALUE self, VALUE args, int kw_splat)
VALUE vret;
rb_proc_t *proc;
int argc = check_argc(RARRAY_LEN(args));
- const VALUE *argv = RARRAY_CONST_PTR(args);
+
+ // rb_vm_invoke_proc may end up modifying argv as part of calling and so we
+ // must use RARRAY_PTR, which marks the array as WB_UNPROTECTED instead of
+ // RARRAY_CONST_PTR. Unfortunately this is worse for GC.
+ // See invoke_block_from_c_proc
+ VALUE *argv = RARRAY_PTR(args);
GetProcPtr(self, proc);
vret = rb_vm_invoke_proc(GET_EC(), proc, argc, argv,
kw_splat, VM_BLOCK_HANDLER_NONE);