diff --git a/ChangeLog b/ChangeLog index 52019c84b9..9e1c2d0af0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 25 03:51:55 2007 Koichi Sasada + + * compile.c (iseq_compile_each): fix stack consistency bug. + a patch from Yusuke ENDOH + Tue Dec 25 03:19:47 2007 WATANABE Hirofumi * tool/make-snapshot: must create configure and lex.c. diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb index 5fd948cdff..4be2f0cddb 100644 --- a/bootstraptest/test_syntax.rb +++ b/bootstraptest/test_syntax.rb @@ -681,3 +681,12 @@ assert_equal 'ok', %q{ end # direct }, '[ruby-core:14385]' +assert_equal 'ok', %q{ + counter = 2 + while true + counter -= 1 + break if counter == 0 + "#{next}" + end + :ok +} diff --git a/compile.c b/compile.c index 9f79c056fa..a3dea41793 100644 --- a/compile.c +++ b/compile.c @@ -2973,7 +2973,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) if (iseq->compile_data->redo_label != 0) { /* next in while loop */ debugs("next in while\n"); - pop_after_throw = 1; + pop_after_throw = poped; goto next_by_throw; } else if (iseq->compile_data->end_label) {