[#39548] [Bug #2291] Net::FTPでソケットをオープンする前にbinary=を呼び出すと落ちる — Akira Matsuda <redmine@...>

Bug #2291: Net::FTPでソケットをオープンする前にbinary=を呼び出すと落ちる

10 messages 2009/10/27

[#39592] infinite recursive call to C function — Yusuke ENDOH <mame@...>

遠藤です。

17 messages 2009/10/30
[#39596] Re: infinite recursive call to C function — Yukihiro Matsumoto <matz@...> 2009/10/30

まつもと ゆきひろです

[#39599] Re: infinite recursive call to C function — Nobuyoshi Nakada <nobu@...> 2009/11/02

なかだです。

[#39601] Re: infinite recursive call to C function — Yukihiro Matsumoto <matz@...> 2009/11/02

まつもと ゆきひろです

[ruby-dev:39483] [Bug #2208] Exception#inspect の message 部が inspect されていない

From: Yui NARUSE <redmine@...>
Date: 2009-10-14 08:38:56 UTC
List: ruby-dev #39483
Bug #2208: Exception#inspect の message 部が inspect されていない
http://redmine.ruby-lang.org/issues/show/2208

起票者: Yui NARUSE
ステータス: Open, 優先度: Normal
カテゴリ: core
ruby -v: ruby 1.9.2dev (2009-10-13 trunk 25324) [x86_64-freebsd7.2]

通常 Object#inspect の結果にでてくる文字列は inspect されています。
しかし、Exception#inspect はそのままになっています。

class Foo;def initialize;@a="\t";end;end
Foo.new.inspect #=> #<Foo:0x000008012dffd8 @a="\t">

Exception.new("\t") #=> #<Exception: "\t">

単なるかけ忘れな気がするのですがどうでしょう。

diff --git a/error.c b/error.c
index a7342de..3a5580a 100644
--- a/error.c
+++ b/error.c
@@ -458,7 +458,7 @@ exc_exception(int argc, VALUE *argv, VALUE self)
 static VALUE
 exc_to_s(VALUE exc)
 {
-    VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
+    VALUE mesg = rb_inspect(rb_attr_get(exc, rb_intern("mesg")));

     if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
     if (OBJ_TAINTED(exc)) OBJ_TAINT(mesg);


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next