From 02e2b50599415deafaf2fc148b628d42ce4c79b8 Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 28 Dec 2008 09:40:24 +0000 Subject: merges r21086 from trunk into ruby_1_9_1. * eval.c (get_errinfo): return th->errinfo value if normal errinfo place (dynamic local viriable) is not found. fixes Bug #732 [ruby-dev:37046]. * bootstraptest/test_proc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ bootstraptest/test_proc.rb | 8 ++++++++ eval.c | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2f4f4400b8..8ed953b2a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Dec 27 13:36:55 2008 Koichi Sasada + + * eval.c (get_errinfo): return th->errinfo value + if normal errinfo place (dynamic local viriable) is not found. + fixes Bug #732 [ruby-dev:37046]. + + * bootstraptest/test_proc.rb: add a test. + Sat Dec 27 11:41:45 2008 Koichi Sasada * vm_insnhelper.c (vm_call_method, vm_call_cfunc): use original id instead of diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb index 9bef6ea85e..820dc1f764 100644 --- a/bootstraptest/test_proc.rb +++ b/bootstraptest/test_proc.rb @@ -418,3 +418,11 @@ assert_equal 'foo!', %q{ fp.bar }, 'Subclass of Proc' + +assert_equal 'ok', %q{ + at_exit{ + print $!.message + } + raise "ok" +} + diff --git a/eval.c b/eval.c index 2dd75afa87..74489d3a65 100644 --- a/eval.c +++ b/eval.c @@ -961,7 +961,8 @@ get_errinfo(void) return *ptr; } else { - return Qnil; + rb_thread_t *th = GET_THREAD(); + return th->errinfo; } } -- cgit v1.2.3