Skip to content

Commit

Permalink
[PRISM] Add splatkw to super calls when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed Feb 1, 2024
1 parent d96b458 commit a7b47f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prism_compile.c
Expand Up @@ -7430,7 +7430,6 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
PM_PUTSELF;

int argc = pm_setup_args(super_node->arguments, &flags, &keywords, iseq, ret, popped, scope_node, dummy_line_node, parser);

flags |= VM_CALL_SUPER | VM_CALL_FCALL;

if (super_node->block) {
Expand All @@ -7453,6 +7452,10 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
}
}

if ((flags & VM_CALL_ARGS_BLOCKARG) && (flags & VM_CALL_KW_SPLAT) && !(flags & VM_CALL_KW_SPLAT_MUT)) {
ADD_INSN(args, &dummy_line_node, splatkw);
}

ADD_SEQ(ret, args);
ADD_INSN2(ret, &dummy_line_node, invokesuper,
new_callinfo(iseq, 0, argc, flags, keywords, parent_block != NULL),
Expand Down

0 comments on commit a7b47f9

Please sign in to comment.