diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 10:56:25 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 10:56:25 +0000 |
commit | 23cc3c2b87f0b884676c799f1ad21a9fdf627429 (patch) | |
tree | de513e8ffd2c8465d616bdb36ad707fc9a724089 /compile.c | |
parent | 66b90d0f5c38ad4d8585cfc9e4d2ca923cc08539 (diff) |
merges r24323 from trunk into ruby_1_9_1.
--
* 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/branches/ruby_1_9_1@24451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -3804,12 +3804,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 { |