diff --git a/ChangeLog b/ChangeLog index 67c6c4519d..006aeaddb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 17 05:31:31 2013 Koichi Sasada + + * error.c (rb_bug_reporter_add): return simply 0 if failed. + Please check return value. + Thu Oct 17 05:17:33 2013 Koichi Sasada * ext/objspace/object_tracing.c: add new method diff --git a/error.c b/error.c index 7f5f2e0385..ec2ad350f1 100644 --- a/error.c +++ b/error.c @@ -278,13 +278,13 @@ rb_bug_reporter_add(void (*func)(FILE *, void *), void *data) { 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