diff options
author | Jeremy Evans <code@jeremyevans.net> | 2023-12-12 16:48:26 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2023-12-14 08:13:43 -0800 |
commit | a18819e65fa2dd3135909df81534937dadafb6ab (patch) | |
tree | 37719ea0262406323c3d89d1b65b7e1867a0cbe6 /compile.c | |
parent | 247ce712fcf93d28ceb359b66dfcf8f76e2c731d (diff) |
Fix op asgn method calls passing mutable keyword splats
When passing the keyword splat to [], it cannot be mutable, because
mutating the keyword splat inside [] would result in changes to the
keyword splat passed to []=.
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -8908,7 +8908,7 @@ compile_op_asgn1(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const node } ADD_INSN1(ret, node, dupn, INT2FIX(dup_argn)); flag |= asgnflag; - ADD_SEND_R(ret, node, idAREF, argc, NULL, INT2FIX(flag), keywords); + ADD_SEND_R(ret, node, idAREF, argc, NULL, INT2FIX(flag & ~VM_CALL_KW_SPLAT_MUT), keywords); if (id == idOROP || id == idANDOP) { /* a[x] ||= y or a[x] &&= y |