Skip to content

Commit

Permalink
Make sure to never use B::PADOP->gv, as it tries to look up values fr…
Browse files Browse the repository at this point in the history
…om random pads.

This can easily lead to segfaults. See also perl RT#74040.
  • Loading branch information
rafl committed Apr 5, 2010
1 parent 90a815b commit 248a233
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/Devel/Caller.pm
Expand Up @@ -92,14 +92,19 @@ sub called_with {
}

my $consider = ($op->name eq "gvsv") ? $op : $prev;
my $gv = $consider->gv;
print "consider: $consider ", $consider->name, " gv $gv\n"
if $DEBUG;
my $gv;

if (ref $consider eq 'B::PADOP') {
print "GV is really a padgv\n" if $DEBUG;
$gv = $padv->ARRAYelt( $consider->padix );
print "NEW GV $gv\n" if $DEBUG;
}
else {
$gv = $consider->gv;
}

print "consider: $consider ", $consider->name, " gv $gv\n"
if $DEBUG;

if ($want_names) {
my %sigils = (
Expand Down

0 comments on commit 248a233

Please sign in to comment.