From 54163e2b52559d8c996607c0df635743d47af81b Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 23 Aug 2011 15:44:26 +0000 Subject: * thread.c (update_coverage): skip coverage count up if the current line is out of the way. rb_sourceline() is unreliable when source code is big. [ruby-dev:44413] * test/coverage/test_coverage.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 6970d8f62b..57a69629a6 100644 --- a/thread.c +++ b/thread.c @@ -4764,7 +4764,7 @@ update_coverage(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klas long line = rb_sourceline() - 1; long count; if (RARRAY_PTR(coverage)[line] == Qnil) { - rb_bug("bug"); + return; } count = FIX2LONG(RARRAY_PTR(coverage)[line]) + 1; if (POSFIXABLE(count)) { -- cgit v1.2.3