mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* compile.c (iseq_compile_each): fix stack consistency error.
a patch from Yusuke ENDOH <mame AT tsg.ne.jp> [ruby-dev:32720] * bootstraptest/test_syntax.rb: add 2 tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bfc19ade2e
commit
1af43d329f
3 changed files with 31 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Dec 25 11:20:38 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* compile.c (iseq_compile_each): fix stack consistency error.
|
||||
a patch from Yusuke ENDOH <mame AT tsg.ne.jp> [ruby-dev:32720]
|
||||
|
||||
* bootstraptest/test_syntax.rb: add 2 tests for above.
|
||||
|
||||
Tue Dec 25 11:14:20 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* iseq.c, vm_core.h: comment out unused fields.
|
||||
|
|
|
@ -690,3 +690,25 @@ assert_equal 'ok', %q{
|
|||
end
|
||||
:ok
|
||||
}
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
counter = 2
|
||||
while true
|
||||
counter -= 1
|
||||
break if counter == 0
|
||||
next
|
||||
redo
|
||||
end
|
||||
:ok
|
||||
}
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
counter = 2
|
||||
while true
|
||||
counter -= 1
|
||||
break if counter == 0
|
||||
next
|
||||
"#{ redo }"
|
||||
end
|
||||
:ok
|
||||
}
|
||||
|
|
|
@ -3027,7 +3027,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
|
|||
if (iseq->compile_data->redo_label) {
|
||||
debugs("redo in while");
|
||||
#if 1
|
||||
pop_after_throw = 1;
|
||||
pop_after_throw = poped;
|
||||
goto redo_by_throw;
|
||||
#else
|
||||
add_ensure_iseq(ret, iseq);
|
||||
|
@ -3070,6 +3070,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
|
|||
ip = ip->parent_iseq;
|
||||
}
|
||||
if (ip != 0) {
|
||||
ADD_INSN(ret, nd_line(node), putnil);
|
||||
ADD_INSN1(ret, nd_line(node), throw,
|
||||
INT2FIX(level | 0x05) /* TAG_REDO */ );
|
||||
|
||||
|
|
Loading…
Reference in a new issue