merge revision(s) 33030:

* 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/branches/ruby_1_9_3@34181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2012-01-03 00:27:45 +00:00
parent 60f63dc385
commit d0ad683bb2
4 changed files with 35 additions and 6 deletions

View file

@ -4804,7 +4804,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)) {