1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

compile.c: fallback nil

* compile.c (iseq_compile_each): push fallback nil only when
  defined guard is added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-01-03 10:49:12 +00:00
parent 7e001f288b
commit 6f31dcd72f

View file

@ -6107,13 +6107,14 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
}
else {
LABEL *lfinish[2];
LINK_ELEMENT *last = ret->last;
lfinish[0] = NEW_LABEL(line);
lfinish[1] = 0;
ADD_INSN(ret, line, putnil);
defined_expr(iseq, ret, node->nd_head, lfinish, Qtrue);
ADD_INSN(ret, line, swap);
ADD_INSN(ret, line, pop);
if (lfinish[1]) {
INSERT_ELEM_NEXT(last, &new_insn_body(iseq, line, BIN(putnil), 0)->link);
ADD_INSN(ret, line, swap);
ADD_INSN(ret, line, pop);
ADD_LABEL(ret, lfinish[1]);
}
ADD_LABEL(ret, lfinish[0]);