Skip to content

Commit cf9a6c2

Browse files
committed
merge revision(s) a3562c2: [Backport #20701]
Remove incorrect setting of KW_SPLAT_MUT flag Fixes [Bug #20701] Co-authored-by: Pablo Herrero <[email protected]>
1 parent d83b563 commit cf9a6c2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

compile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6105,7 +6105,6 @@ setup_args_core(rb_iseq_t *iseq, LINK_ANCHOR *const args, const NODE *argn,
61056105
if (kwnode) {
61066106
// kwsplat
61076107
*flag_ptr |= VM_CALL_KW_SPLAT;
6108-
*flag_ptr |= VM_CALL_KW_SPLAT_MUT;
61096108
compile_hash(iseq, args, kwnode, TRUE, FALSE);
61106109
argc += 1;
61116110
}

test/ruby/test_call.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,18 @@ def self.f(*a, **kw)
327327
assert_equal Hash, f(*[], **o).class
328328
end
329329

330+
def test_call_args_splat_with_pos_arg_kw_splat_is_not_mutable
331+
o = Object.new
332+
def o.foo(a, **h)= h[:splat_modified] = true
333+
334+
a = []
335+
b = {splat_modified: false}
336+
337+
o.foo(*a, :x, **b)
338+
339+
assert_equal({splat_modified: false}, b)
340+
end
341+
330342
def test_kwsplat_block_order
331343
o = Object.new
332344
ary = []

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
1212
#define RUBY_VERSION_TEENY 4
1313
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
14-
#define RUBY_PATCHLEVEL 98
14+
#define RUBY_PATCHLEVEL 99
1515

1616
#include "ruby/version.h"
1717
#include "ruby/internal/abi.h"

0 commit comments

Comments
 (0)