diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | error.c | 5 |
2 files changed, 8 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Thu Jan 13 06:27:29 2011 Ryan Davis <ryand-ruby@zenspider.com> + + * error.c: Exception#to_s should actually call to_s. + Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@ruby-lang.org> * addr2line.c (get_nth_dirname): decrement the directory index @@ -522,9 +522,12 @@ static VALUE exc_to_s(VALUE exc) { VALUE mesg = rb_attr_get(exc, rb_intern("mesg")); + VALUE r = Qnil; if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc)); - return rb_String(mesg); + r = rb_String(mesg); + OBJ_INFECT(r, exc); + return r; } /* |