From: Father Chrysostomos Date: Sat, 4 Oct 2014 17:22:12 +0000 (+0200) Subject: Teach this module about perl 5.21.4 X-Git-Tag: rt99177^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=58937735f503800dec4d1ff467d3177a080c67bc;p=perl%2Fmodules%2FB-RecDeparse.git Teach this module about perl 5.21.4 This fixes RT #99177. --- diff --git a/lib/B/RecDeparse.pm b/lib/B/RecDeparse.pm index 7c192cb..3f940da 100644 --- a/lib/B/RecDeparse.pm +++ b/lib/B/RecDeparse.pm @@ -194,8 +194,9 @@ sub pp_gv { my $self = shift; my $gv = $self->gv_or_padgv($_[0]); - my $name = $gv->NAME; - my $cv = $gv->CV; + my $cv = $gv->FLAGS & B::SVf_ROK ? $gv->RV : undef; + my $name = $cv ? $cv->NAME_HEK || $cv->GV->NAME : $gv->NAME; + $cv ||= $gv->CV; my $seen = $self->{brd_seen}; my $body; @@ -206,7 +207,7 @@ sub pp_gv { $body = do { local @{$self}{qw} = (0, $self->{brd_cur} + 1); local $seen->{$name} = 1; - 'sub ' . $self->indent($self->deparse_sub($gv->CV)); + 'sub ' . $self->indent($self->deparse_sub($cv)); }; if (FOOL_SINGLE_DELIM) {