From: nobu.nakada@... Date: 2002-01-23T13:10:15+09:00 Subject: [ruby-dev:15752] [PATCH] sourceline after yield なかだです。 $ ruby -v -e 'def foo;yield and raise;end' -e 'foo{true}' -e:2:in `foo': unhandled exception from -e:2 ruby 1.7.2 (2002-01-21) [i686-linux] unhandled exceptionは-e:1でないとまずいのでは。 Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.249 diff -u -2 -p -r1.249 eval.c --- eval.c 2002/01/21 07:44:05 1.249 +++ eval.c 2002/01/23 03:56:16 @@ -3671,4 +3671,6 @@ rb_yield_0(val, self, klass, pcall) struct SCOPE * volatile old_scope; struct FRAME frame; + char *const file = ruby_sourcefile; + int line = ruby_sourceline; int state; static unsigned serial = 1; @@ -3795,4 +3797,6 @@ rb_yield_0(val, self, klass, pcall) scope_dup(old_scope); ruby_scope = old_scope; + ruby_sourcefile = file; + ruby_sourceline = line; if (state) { if (!block->tag) { -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦