diff --git a/ChangeLog b/ChangeLog index 262b21a068..b3fb855e1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Aug 29 13:22:43 2010 Nobuyoshi Nakada + + * vm.c (rb_thread_method_id_and_class): curried proc has no + method. [ruby-core:31871] + Sun Aug 29 12:51:33 2010 Nobuyoshi Nakada * load.c (rb_provide_feature): clarify error message for frozen diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 5a108d3a0f..1a473ae43d 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -792,4 +792,12 @@ class TestProc < Test::Unit::TestCase assert_equal([obj, nil], [a, b], '[ruby-core:24139]') end end + + def test_curry_with_trace + bug3751 = '[ruby-core:31871]' + set_trace_func(proc {}) + test_curry + ensure + set_trace_func(nil) + end end diff --git a/vm.c b/vm.c index 558e9805f6..5d249e584e 100644 --- a/vm.c +++ b/vm.c @@ -1394,7 +1394,7 @@ rb_thread_method_id_and_class(rb_thread_t *th, { rb_control_frame_t *cfp = th->cfp; rb_iseq_t *iseq = cfp->iseq; - if (!iseq) { + if (!iseq && cfp->me) { if (idp) *idp = cfp->me->def->original_id; if (klassp) *klassp = cfp->me->klass; return 1;