From: Yukihiro Matsumoto Date: 2009-06-17T19:01:44+09:00 Subject: [ruby-dev:38668] Re: [ruby-core:23736] [Bug #1584] return from lambda within 2 procs freezes まつもと ゆきひろです In message "Re: [ruby-core:23736] [Bug #1584] return from lambda within 2 procs freezes" on Sun, 7 Jun 2009 04:45:48 +0900, Glen Gerstman writes: |I hope this is where to post this? | |This will freeze(full cpu) before the end. | |puts 'begin' |->{proc{proc{return}.call}.call}.call |puts 'end' 以下のようなパッチで報告された問題は発生しなくなりました。また、make testやtest/ruby/test_*.rbでは新たなエラーは発生していませんが、中身が よくわからないので、確証が持てません。 diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 5b47385..eb1c5da 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1351,6 +1351,9 @@ vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp, dfp = cfp->dfp; goto valid_return; } + else { + dfp = tdfp; + } tdfp = GC_GUARDED_PTR_REF((VALUE *)*dfp); } }