Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

B::CV::GV can return undef as of 5.18.1.

  • Loading branch information...
commit a1a7d23281b97012edb73ee90503d23d8850f5e1 1 parent d99a5ad
Paul Johnson authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 lib/Devel/Cover.pm
13 lib/Devel/Cover.pm
View
@@ -653,10 +653,11 @@ sub sub_info
{
my ($cv) = @_;
my ($name, $start) = ("--unknown--", 0);
- if (!$cv->GV->isa("B::SPECIAL"))
+ my $gv = $cv->GV;
+ if ($gv && !$gv->isa("B::SPECIAL"))
{
- return unless $cv->GV->can("SAFENAME");
- $name = $cv->GV->SAFENAME;
+ return unless $gv->can("SAFENAME");
+ $name = $gv->SAFENAME;
# print STDERR "--[$name]--\n";
$name =~ s/(__ANON__)\[.+:\d+\]/$1/ if defined $name;
}
@@ -755,6 +756,7 @@ EOM
sub _report
{
local @SIG{qw(__DIE__ __WARN__)};
+ # $SIG{__DIE__} = \&Carp::confess;
$Run{finish} = get_elapsed() / 1e6;
@@ -1269,9 +1271,10 @@ sub get_cover
if ($Pod && $Coverage{pod})
{
- unless ($cv->GV->isa("B::SPECIAL"))
+ my $gv = $cv->GV;
+ if ($gv && !$gv->isa("B::SPECIAL"))
{
- my $stash = $cv->GV->STASH;
+ my $stash = $gv->STASH;
my $pkg = $stash->NAME;
my $file = $cv->FILE;
my %opts;
Please sign in to comment.
Something went wrong with that request. Please try again.