[前][次][番号順一覧][スレッド一覧]

ruby-changes:31233

From: ko1 <ko1@a...>
Date: Thu, 17 Oct 2013 05:32:32 +0900 (JST)
Subject: [ruby-changes:31233] ko1:r43312 (trunk): * error.c (rb_bug_reporter_add): return simply 0 if failed.

ko1	2013-10-17 05:32:28 +0900 (Thu, 17 Oct 2013)

  New Revision: 43312

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43312

  Log:
    * error.c (rb_bug_reporter_add): return simply 0 if failed.
      Please check return value.

  Modified files:
    trunk/ChangeLog
    trunk/error.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43311)
+++ ChangeLog	(revision 43312)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Oct 17 05:31:31 2013  Koichi Sasada  <ko1@a...>
+
+	* error.c (rb_bug_reporter_add): return simply 0 if failed.
+	  Please check return value.
+
 Thu Oct 17 05:17:33 2013  Koichi Sasada  <ko1@a...>
 
 	* ext/objspace/object_tracing.c: add new method
Index: error.c
===================================================================
--- error.c	(revision 43311)
+++ error.c	(revision 43312)
@@ -278,13 +278,13 @@ rb_bug_reporter_add(void (*func)(FILE *, https://github.com/ruby/ruby/blob/trunk/error.c#L278
 {
     struct bug_reporters *reporter;
     if (bug_reporters_size >= MAX_BUG_REPORTERS) {
-	rb_bug("rb_bug_reporter_add: overflow");
+	return 0; /* failed to register */
     }
     reporter = &bug_reporters[bug_reporters_size++];
     reporter->func = func;
     reporter->data = data;
 
-    return bug_reporters_size;
+    return 1;
 }
 
 static void

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]