diff options
author | wanabe <s.wanabe@gmail.com> | 2020-08-09 17:49:11 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <kazuki@callcc.net> | 2020-08-16 18:39:08 +0900 |
commit | 691f10dd89e8a3feedab5bea823038469b3d6d66 (patch) | |
tree | 564841e133efe2f9a1effeedec3ad226a0d407c2 | |
parent | 6c407b3668d7acf8e744878fc3577a014a600bb7 (diff) |
Adjust sp for `case ... in *, a, * end`
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3403
-rw-r--r-- | compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -5929,6 +5929,7 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c ADD_INSN(ret, line, pop); ADD_INSN(ret, line, pop); ADD_INSNL(ret, line, jump, match_failed); + ADD_INSN1(ret, line, dupn, INT2FIX(3)); ADD_LABEL(ret, find_succeeded); ADD_INSN(ret, line, pop); @@ -5938,12 +5939,14 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c ADD_INSN(ret, line, pop); ADD_INSNL(ret, line, jump, matched); + ADD_INSN(ret, line, putnil); ADD_LABEL(ret, type_error); ADD_INSN1(ret, line, putspecialobject, INT2FIX(VM_SPECIAL_OBJECT_VMCORE)); ADD_INSN1(ret, line, putobject, rb_eTypeError); ADD_INSN1(ret, line, putobject, rb_fstring_lit("deconstruct must return Array")); ADD_SEND(ret, line, id_core_raise, INT2FIX(2)); + ADD_INSN(ret, line, pop); ADD_LABEL(ret, match_failed); ADD_INSN(ret, line, pop); |