summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-14 09:36:18 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-14 09:36:18 +0000
commit15e1ff7f2398f03d392fb1aeea355c124dfa4874 (patch)
tree1ce4b9ea42d0122a327a5b6a5183760a90ee0e2f /error.c
parentc53470fd47fa62eed38af281017e10a41ef8ff2a (diff)
* error.c (exc_equal): clear rb_thread_t::errinfo when ignore
an exception under rb_protect(). [ruby-core:41979] [Bug #5865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/error.c b/error.c
index 3b80a24bdd..03e22bfa3a 100644
--- a/error.c
+++ b/error.c
@@ -746,7 +746,10 @@ exc_equal(VALUE exc, VALUE obj)
CONST_ID(id_backtrace, "backtrace");
obj = rb_protect(try_convert_to_exception, obj, &status);
- if (status || obj == Qundef) return Qfalse;
+ if (status || obj == Qundef) {
+ rb_set_errinfo(Qnil);
+ return Qfalse;
+ }
if (rb_obj_class(exc) != rb_obj_class(obj)) return Qfalse;
mesg = rb_check_funcall(obj, id_message, 0, 0);
if (mesg == Qundef) return Qfalse;