diff --git a/ChangeLog b/ChangeLog index 9346837320..88fee26182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Dec 18 23:53:53 2007 Nobuyoshi Nakada + + * compile.c (iseq_compile_each): fix for segfault. [ruby-dev:31372] + Tue Dec 18 23:44:32 2007 GOTOU Yuuzou * test/net/http/utils.rb: split TestNetHTTPUtils module from diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb index ed3deba989..2f5e912074 100644 --- a/bootstraptest/test_eval.rb +++ b/bootstraptest/test_eval.rb @@ -188,3 +188,8 @@ assert_equal %q{[10, main]}, %q{ C.new(&$pr) $ans } + +assert_match /Illegal break/, %q{ + STDERR.reopen(STDOUT) + eval "0 rescue break" +}, '[ruby-dev:31372]' diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index e585ba5fe2..345e5c68df 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -35,10 +35,6 @@ assert_equal 'ok', %q{ end } -assert_normal_exit %q{ - eval "0 rescue break" -}, '[ruby-dev:31372]' - assert_normal_exit %q{ eval "while true; return; end rescue p $!" }, '[ruby-dev:31663]' diff --git a/compile.c b/compile.c index f77851f777..bd5bfa9954 100644 --- a/compile.c +++ b/compile.c @@ -2946,7 +2946,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) } else { rb_iseq_t *ip = iseq->parent_iseq; - while (ip) { + while (ip && ip->compile_data) { level++; if (ip->compile_data->redo_label != 0) { level = 0x8000;