diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-08 12:00:32 -0300 |
---|---|---|
committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-09 09:45:59 -0300 |
commit | ae1fad4cd7d88b464aaebad3d5769d27ba675183 (patch) | |
tree | f5297aabf77829178fcc356fd91212d0debf6979 /prism_compile.c | |
parent | ea1b1ea1aa98bc9488564ef18aa4032aa1cb5536 (diff) | |
download | ruby-ae1fad4cd7d88b464aaebad3d5769d27ba675183.tar.gz |
[PRISM] Implement compilation for ForwardingArgumentssNode
Diffstat (limited to 'prism_compile.c')
-rw-r--r-- | prism_compile.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/prism_compile.c b/prism_compile.c index b5dc08f074..3f02b858f9 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -1413,6 +1413,14 @@ pm_setup_args(pm_arguments_node_t *arguments_node, int *flags, struct rb_callinf break; } + case PM_FORWARDING_ARGUMENTS_NODE: { + orig_argc++; + *flags |= VM_CALL_ARGS_BLOCKARG | VM_CALL_ARGS_SPLAT; + ADD_GETLOCAL(ret, &dummy_line_node, 3, 0); + ADD_INSN1(ret, &dummy_line_node, splatarray, RBOOL(arguments_node_list.size > 1)); + ADD_INSN2(ret, &dummy_line_node, getblockparamproxy, INT2FIX(4), INT2FIX(0)); + break; + } default: { orig_argc++; post_splat_counter++; @@ -2313,6 +2321,10 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, ADD_CATCH_ENTRY(CATCH_TYPE_BREAK, retry_label, retry_end_l, child_iseq, retry_end_l); return; } + case PM_FORWARDING_ARGUMENTS_NODE: { + rb_bug("Should never hit the forwarding arguments case directly\n"); + return; + } case PM_FORWARDING_SUPER_NODE: { pm_forwarding_super_node_t *forwarding_super_node = (pm_forwarding_super_node_t *) node; const rb_iseq_t *block = NULL; |