diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-29 15:50:46 -0500 |
---|---|---|
committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-29 16:14:28 -0500 |
commit | 2233204cc17521b960dad8b3758e6e0631a13672 (patch) | |
tree | 79015797aff734d574d41221634e5127c8dbf0f8 /prism_compile.c | |
parent | 53841941f0e9bce92116c673e3d5426d94573103 (diff) | |
download | ruby-2233204cc17521b960dad8b3758e6e0631a13672.tar.gz |
[PRISM] Account for ImplicitRestNode
Prism introduced a new ImplicitRestNode. This adds tests for the
ImplicitRestNode cases, and changes one assert which is no longer
accurate.
Diffstat (limited to 'prism_compile.c')
-rw-r--r-- | prism_compile.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/prism_compile.c b/prism_compile.c index ab3fc79818..ca416547bb 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -3313,14 +3313,11 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, PM_DUP_UNLESS_POPPED; pm_node_t *rest_expression = NULL; - if (multi_write_node->rest) { - RUBY_ASSERT(PM_NODE_TYPE_P(multi_write_node->rest, PM_SPLAT_NODE)); - + if (multi_write_node->rest && PM_NODE_TYPE_P(multi_write_node->rest, PM_SPLAT_NODE)) { pm_splat_node_t *rest_splat = ((pm_splat_node_t *)multi_write_node->rest); rest_expression = rest_splat->expression; } - if (lefts->size) { ADD_INSN2(ret, &dummy_line_node, expandarray, INT2FIX(lefts->size), INT2FIX((int) (bool) (rights->size || rest_expression))); for (size_t index = 0; index < lefts->size; index++) { |