[ruby-core:60931] Re: [ruby-trunk - Feature #9508] Add method coverage and branch coverage metrics

From: Eric Wong <normalperson@...>
Date: 2014-02-21 07:57:07 UTC
List: ruby-core #60931
sam.rawlins@gmail.com wrote:
> Good call Eric. I've carried out your suggestion [1], and attached the cumulative patch.
> 
> [1] this commit: https://github.com/srawlins/ruby/commit/cc50eab44f5ce0a4febdc05bdd99a09708e78b7e

Thanks Sam!  I didn't check very closely, but in places where before
where you checked for "iseq->coverage" being true, now jumps straight
to "iseq->coverage->(methods|branches|lines)".

Wouldn't that crash if iseq->coverage isn't set at all?

Unless I'm missing another check elsewhere, perhaps checking:

	(iseq->coverage && iseq->coverage->FOO)

is safer.

In This Thread

Prev Next