summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-13 07:44:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-01-13 07:44:50 +0000
commita5bfe7ca837c81e2df0329d4004fabfb4178362e (patch)
treeb3e93c9c232d21d9bb0c82c344572851cf1f7353 /error.c
parent1c58146ee508ee8d0621c4163b84676011a11ad0 (diff)
* error.c (exc_equal): try implicit conversion for delegator.
[ruby-core:41979] [Bug #5865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/error.c b/error.c
index 6844f992a6..a600b171db 100644
--- a/error.c
+++ b/error.c
@@ -732,10 +732,14 @@ exc_equal(VALUE exc, VALUE obj)
CONST_ID(id_mesg, "mesg");
if (rb_obj_class(exc) != rb_obj_class(obj)) {
- ID id_message, id_backtrace;
+ ID id_exception, id_message, id_backtrace;
+ CONST_ID(id_exception, "exception");
CONST_ID(id_message, "message");
CONST_ID(id_backtrace, "backtrace");
+ obj = rb_check_funcall(obj, id_exception, 0, 0);
+ if (obj == Qundef) 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;
backtrace = rb_check_funcall(obj, id_backtrace, 0, 0);