aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-13 00:11:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-13 00:11:24 +0000
commit44251ef50a30528f1d202b402b0b8d3a4fc518cb (patch)
treed0192025066e367a4537c78e2c176322ae5bfb56 /compile.c
parent8ef14d2b4dd99b06d33a5a9c337aa65c6ad4c72e (diff)
downloadruby-44251ef50a30528f1d202b402b0b8d3a4fc518cb.tar.gz
compile.c: omit newrange
* compile.c (iseq_compile_each): omit creating literal-only range to be popped immediately. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/compile.c b/compile.c
index 1cd21d82ca..118055954b 100644
--- a/compile.c
+++ b/compile.c
@@ -6088,16 +6088,13 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp
iseq_add_mark_object_compile_time(iseq, val);
ADD_INSN1(ret, line, putobject, val);
}
- break;
- }
- CHECK(COMPILE(ret, "min", (NODE *) node->nd_beg));
- CHECK(COMPILE(ret, "max", (NODE *) node->nd_end));
- if (popped) {
- ADD_INSN(ret, line, pop);
- ADD_INSN(ret, line, pop);
}
else {
- ADD_INSN1(ret, line, newrange, flag);
+ CHECK(COMPILE_(ret, "min", b, popped));
+ CHECK(COMPILE_(ret, "max", e, popped));
+ if (!popped) {
+ ADD_INSN1(ret, line, newrange, flag);
+ }
}
break;
}