summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorwanabe <s.wanabe@gmail.com>2020-08-08 23:14:30 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2020-08-16 18:39:08 +0900
commit6c407b3668d7acf8e744878fc3577a014a600bb7 (patch)
treeca08ccbd518a357dcd401ff028d674f78c23f197 /compile.c
parentc866d6563f2295d12225addc2e4f8edb677c4e2d (diff)
Adjust sp for `case ... in *v end`/`case ... in v1, v2 end`
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3403
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index dbdb4b9127..def5a4ab66 100644
--- a/compile.c
+++ b/compile.c
@@ -5771,6 +5771,9 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c
}
ADD_INSNL(ret, line, jump, matched);
ADD_INSN(ret, line, putnil);
+ if (use_rest_num) {
+ ADD_INSN(ret, line, putnil);
+ }
ADD_LABEL(ret, type_error);
ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE));