Skip to content

Commit 7e1b2a8

Browse files
committed
Fix Ruby head build
1 parent 6f2dcce commit 7e1b2a8

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

lib/syntax_tree/yarv/compiler.rb

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -663,32 +663,10 @@ def visit_call(node)
663663
when ArgsForward
664664
flag |= CallData::CALL_TAILCALL if options.tailcall_optimization?
665665

666-
if RUBY_VERSION < "3.2"
667-
flag |= CallData::CALL_ARGS_SPLAT
668-
lookup = iseq.local_table.find(:*)
669-
iseq.getlocal(lookup.index, lookup.level)
670-
iseq.splatarray(arg_parts.length != 1)
671-
else
672-
flag |= CallData::CALL_ARGS_SPLAT
673-
lookup = iseq.local_table.find(:*)
674-
iseq.getlocal(lookup.index, lookup.level)
675-
iseq.splatarray(true)
676-
677-
flag |= CallData::CALL_KW_SPLAT
678-
iseq.putspecialobject(PutSpecialObject::OBJECT_VMCORE)
679-
iseq.newhash(0)
680-
lookup = iseq.local_table.find(:**)
681-
iseq.getlocal(lookup.index, lookup.level)
682-
iseq.send(
683-
YARV.calldata(
684-
:"core#hash_merge_kwd",
685-
2,
686-
CallData::CALL_ARGS_SIMPLE
687-
)
688-
)
689-
iseq.newarray(1)
690-
iseq.concatarray
691-
end
666+
flag |= CallData::CALL_ARGS_SPLAT
667+
lookup = iseq.local_table.find(:*)
668+
iseq.getlocal(lookup.index, lookup.level)
669+
iseq.splatarray(arg_parts.length != 1)
692670

693671
flag |= CallData::CALL_ARGS_BLOCKARG
694672
lookup = iseq.local_table.find(:&)
@@ -1339,14 +1317,13 @@ def visit_params(node)
13391317
if node.keyword_rest.is_a?(ArgsForward)
13401318
if RUBY_VERSION >= "3.2"
13411319
iseq.local_table.plain(:*)
1342-
iseq.local_table.plain(:**)
13431320
iseq.local_table.plain(:&)
1321+
iseq.local_table.plain(:"...")
13441322

13451323
iseq.argument_options[:rest_start] = iseq.argument_size
1346-
iseq.argument_options[:block_start] = iseq.argument_size + 2
1347-
iseq.argument_options[:kwrest] = iseq.argument_size + 1
1324+
iseq.argument_options[:block_start] = iseq.argument_size + 1
13481325

1349-
iseq.argument_size += 3
1326+
iseq.argument_size += 2
13501327
else
13511328
iseq.local_table.plain(:*)
13521329
iseq.local_table.plain(:&)

0 commit comments

Comments
 (0)