diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-20 16:16:22 -0500 |
---|---|---|
committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-27 12:51:50 -0500 |
commit | 6d447fa35f877edae96e4a7f98c9f5e70219314b (patch) | |
tree | 0ff3f63881efd4be58096fb794ac64047e79ce33 /prism_compile.c | |
parent | 150ed44d87e2d5b00f38019a487e05a67a303482 (diff) | |
download | ruby-6d447fa35f877edae96e4a7f98c9f5e70219314b.tar.gz |
[PRISM] Don't pop several args related nodes
Diffstat (limited to 'prism_compile.c')
-rw-r--r-- | prism_compile.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/prism_compile.c b/prism_compile.c index 6850c84c04..b66c2e0ed0 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -1354,8 +1354,8 @@ pm_setup_args(pm_arguments_node_t *arguments_node, int *flags, struct rb_callinf case PM_ASSOC_NODE: { pm_assoc_node_t *assoc = (pm_assoc_node_t *)cur_node; - PM_COMPILE(assoc->key); - PM_COMPILE(assoc->value); + PM_COMPILE_NOT_POPPED(assoc->key); + PM_COMPILE_NOT_POPPED(assoc->value); cur_hash_size++; // If we're at the last keyword arg, or the last assoc node of this "set", @@ -1386,7 +1386,7 @@ pm_setup_args(pm_arguments_node_t *arguments_node, int *flags, struct rb_callinf } pm_assoc_splat_node_t *assoc_splat = (pm_assoc_splat_node_t *)cur_node; - PM_COMPILE(assoc_splat->value); + PM_COMPILE_NOT_POPPED(assoc_splat->value); *flags |= VM_CALL_KW_SPLAT | VM_CALL_KW_SPLAT_MUT; @@ -1411,14 +1411,14 @@ pm_setup_args(pm_arguments_node_t *arguments_node, int *flags, struct rb_callinf } else { *kw_arg = rb_xmalloc_mul_add(len, sizeof(VALUE), sizeof(struct rb_callinfo_kwarg)); - *flags |= VM_CALL_KWARG; - (*kw_arg)->keyword_len += len; + *flags = VM_CALL_KWARG; + (*kw_arg)->keyword_len = (int) len; // TODO: Method callers like `foo(a => b)` for (size_t i = 0; i < len; i++) { pm_assoc_node_t *assoc = (pm_assoc_node_t *)keyword_arg->elements.nodes[i]; (*kw_arg)->keywords[i] = pm_static_literal_value(assoc->key, scope_node, parser); - PM_COMPILE(assoc->value); + PM_COMPILE_NOT_POPPED(assoc->value); } } break; |