summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 12:42:41 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 12:42:41 +0000
commitdf878f78c5c53137f1fad3c494362b6d821f8dc1 (patch)
tree04e50575965b636ca630915d6b87914b4db5a4c5 /compile.c
parent5e85648b770f6999bc0020ddddfe0bcdbf5149c5 (diff)
* compile.c (iseq_compile_each): fix stack consistency error.
[ruby-core:24611] * bootstraptest/test_method.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/compile.c b/compile.c
index c3e25dee24..1c5dba5231 100644
--- a/compile.c
+++ b/compile.c
@@ -3799,12 +3799,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
}
ADD_INSNL(ret, nd_line(node), jump, lfin);
ADD_LABEL(ret, label);
- if (id == 0 || id == 1) { /* 0: or, 1: and */
- ADD_INSN(ret, nd_line(node), swap);
- ADD_INSN(ret, nd_line(node), pop);
- ADD_INSN(ret, nd_line(node), swap);
- ADD_INSN(ret, nd_line(node), pop);
- }
+ ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 1));
+ ADD_INSN1(ret, nd_line(node), adjuststack, INT2FIX(FIX2INT(argc) + 1));
ADD_LABEL(ret, lfin);
}
else {