aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-11-01 15:22:08 -0300
committerJemma Issroff <jemmaissroff@gmail.com>2023-11-06 10:39:07 -0300
commitf6ba87ca8899cd753306ffbca475b16c367995a3 (patch)
treeb68e10e175ea4d9203dfca4577d4db7ee636e8fb /compile.c
parent4a6bdbd6dc160c4614105f0478d398b2222429e0 (diff)
downloadruby-f6ba87ca8899cd753306ffbca475b16c367995a3.tar.gz
[PRISM] Implement compilation for MultiWriteNodes, fix MultiTargetNodes
Compilation now works for MultiWriteNodes and MultiTargetNodes, with nesting on MultiWrites. See the tests added in this commit for example behavior.
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/compile.c b/compile.c
index bad3c079fc..9d09bef494 100644
--- a/compile.c
+++ b/compile.c
@@ -5274,7 +5274,6 @@ compile_massign0(rb_iseq_t *iseq, LINK_ANCHOR *const pre, LINK_ANCHOR *const rhs
int llen = 0;
int lpos = 0;
- int expand = 1;
while (lhsn_count) {
llen++;
@@ -5312,7 +5311,6 @@ compile_massign0(rb_iseq_t *iseq, LINK_ANCHOR *const pre, LINK_ANCHOR *const rhs
}
}
-
if (!state->nested) {
NO_CHECK(COMPILE(rhs, "normal masgn rhs", rhsn));
}
@@ -5320,9 +5318,7 @@ compile_massign0(rb_iseq_t *iseq, LINK_ANCHOR *const pre, LINK_ANCHOR *const rhs
if (!popped) {
ADD_INSN(rhs, node, dup);
}
- if (expand) {
- ADD_INSN2(rhs, node, expandarray, INT2FIX(llen), INT2FIX(lhs_splat));
- }
+ ADD_INSN2(rhs, node, expandarray, INT2FIX(llen), INT2FIX(lhs_splat));
return COMPILE_OK;
}