[#39222] [Bug #2036] AIX 5L 5.2にて、ruby-1.8.7-p174のビルド時にmake testをするとエラーになった。not ok float 7 -- ./sample/test.rb:1232 — 和弥 寺元 <redmine@...>

Bug #2036: AIX 5L 5.2にて、ruby-1.8.7-p174のビルド時にmake testをするとエラーになった。not ok float 7 -- ./sample/test.rb:1232

13 messages 2009/09/03

[#39249] [Bug #2060] DLをCからRubyに変換する事を勧めます — Aaron Patterson <redmine@...>

Bug #2060: DLをCからRubyに変換する事を勧めます

10 messages 2009/09/07

[#39282] [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — takeru sasaki <redmine@...>

チケット #2067 が更新されました。 (by takeru sasaki)

15 messages 2009/09/10
[#39283] Re: [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — Yukihiro Matsumoto <matz@...> 2009/09/10

まつもと ゆきひろです

[#39284] Re: [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — Nobuyoshi Nakada <nobu@...> 2009/09/10

なかだです。

[#39297] Re: [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — Yukihiro Matsumoto <matz@...> 2009/09/10

まつもと ゆきひろです

[#39298] Re: [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — Tanaka Akira <akr@...> 2009/09/10

In article <E1MliJq-0000yc-4o@x61.netlab.jp>,

[#39302] Re: [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — takeru sasaki <sasaki.takeru@...> 2009/09/10

言いだしっぺの佐々木です。

[#39307] Re: [Bug #2067] bodyが大きいエラーページをopen-uriで取得するとfdがリークしている — Yukihiro Matsumoto <matz@...> 2009/09/10

まつもと ゆきひろです

[#39345] [Bug #2111] Error:test_rm_f(TestFileUtils) — Kazuhiro NISHIYAMA <redmine@...>

Bug #2111: Error:test_rm_f(TestFileUtils)

11 messages 2009/09/17

[#39352] [ruby19] Thread 切替えが異常に遅い? — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

12 messages 2009/09/20

[#39367] Almost endless loop of BigMath::atan(x) when x.abs >= 1 — "Masahiro Kanai (CanI)" <cani.m.61st@...>

金井 仁弘と申します。

13 messages 2009/09/23
[#39980] Re: Almost endless loop of BigMath::atan(x) when x.abs >= 1 — TOYOFUKU Chikanobu <nobu_toyofuku@...> 2010/01/07

豊福です。遅い反応ですが。

[#39982] Re: Almost endless loop of BigMath::atan(x) when x.abs >= 1 — TOYOFUKU Chikanobu <nobu_toyofuku@...> 2010/01/07

豊福です。

[#39388] Re: [ruby-cvs:32331] Ruby:r25113 (trunk): String#inspect's encoding should be fixed. — "Martin J. Dürst" <duerst@...>

成瀬さん、こんにちは。

9 messages 2009/09/28

[ruby-dev:39400] [Feature:1.9] improvement of method redefinition warning

From: Nobuyoshi Nakada <nobu@...>
Date: 2009-09-29 07:05:34 UTC
List: ruby-dev #39400
なかだです。

メソッド再定義で警告を出すときに、上書きされるほうの定義の場所も
出してはどうでしょうか。


Index: proc.c
===================================================================
--- proc.c	(revision 25152)
+++ proc.c	(working copy)
@@ -649,6 +649,8 @@ rb_proc_arity(VALUE self)
 }
 
-static rb_iseq_t *
-get_proc_iseq(VALUE self, int *is_proc)
+#define get_proc_iseq rb_proc_get_iseq
+
+rb_iseq_t *
+rb_proc_get_iseq(VALUE self, int *is_proc)
 {
     rb_proc_t *proc;
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 25152)
+++ vm_method.c	(working copy)
@@ -189,5 +189,24 @@ rb_add_method_def(VALUE klass, ID mid, r
 	    old_def->type != VM_METHOD_TYPE_UNDEF &&
 	    old_def->type != VM_METHOD_TYPE_ZSUPER) {
+	    extern rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
+	    rb_iseq_t *iseq = 0;
+
 	    rb_warning("method redefined; discarding old %s", rb_id2name(mid));
+	    switch (old_def->type) {
+	      case VM_METHOD_TYPE_ISEQ:
+		iseq = old_def->body.iseq;
+		break;
+	      case VM_METHOD_TYPE_BMETHOD:
+		iseq = rb_proc_get_iseq(old_def->body.proc, 0);
+		break;
+	      default:
+		break;
+	    }
+	    if (iseq && !NIL_P(iseq->filename)) {
+		int line = iseq->insn_info_table ? rb_iseq_first_lineno(iseq) : 0;
+		rb_compile_warning(RSTRING_PTR(iseq->filename), line,
+				   "previous definition of %s was here",
+				   rb_id2name(old_def->original_id));
+	    }
 	}
 	rb_free_method_entry(old_me);
Index: test/ruby/test_class.rb
===================================================================
--- test/ruby/test_class.rb	(revision 25152)
+++ test/ruby/test_class.rb	(working copy)
@@ -115,4 +115,5 @@ class TestClass < Test::Unit::TestCase
     end
     assert_match(/:#{line}: warning: method redefined; discarding old foo/, stderr)
+    assert_match(/:#{line-1}: warning: previous definition of foo/, stderr)
 
     stderr = EnvUtil.verbose_warning do
@@ -142,4 +143,5 @@ class TestClass < Test::Unit::TestCase
     end
     assert_match(/:#{line}: warning: method redefined; discarding old foo/, stderr)
+    assert_match(/:#{line-1}: warning: previous definition of foo/, stderr)
 
     stderr = EnvUtil.verbose_warning do
Index: test/ruby/test_module.rb
===================================================================
--- test/ruby/test_module.rb	(revision 25152)
+++ test/ruby/test_module.rb	(working copy)
@@ -797,4 +797,5 @@ class TestModule < Test::Unit::TestCase
     end
     assert_match(/:#{line}: warning: method redefined; discarding old foo/, stderr)
+    assert_match(/:#{line-1}: warning: previous definition of foo/, stderr)
 
     stderr = EnvUtil.verbose_warning do
@@ -824,4 +825,5 @@ class TestModule < Test::Unit::TestCase
     end
     assert_match(/:#{line}: warning: method redefined; discarding old foo/, stderr)
+    assert_match(/:#{line-1}: warning: previous definition of foo/, stderr)
 
     stderr = EnvUtil.verbose_warning do


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next