Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

C: do not skip GV skip_package symbols, just CVs

I had a case with an NULL @DB::args, which caused if (@DB::args) to crash,
because DB was added to -U. This must not happen.
  • Loading branch information...
commit 3210cc599a11e00978e125f184c1a2a67055bc45 1 parent 68a5c4d
Reini Urban authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/B/C.pm
7 lib/B/C.pm
View
@@ -3442,7 +3442,9 @@ if (0) {
my $package = $gv->STASH->NAME;
my $is_empty = $gv->is_empty;
my $fullname = $package . "::" . $gvname;
- return $sym if $skip_package{$package} or $package =~ /^B::C(C?)::/;
+ # Never skip symbols from skipped packages, as they may lead to NULL ptrs in the stack, when
+ # gv_fetch will need to create them. (i.e. @DB::args). Only skip CVs.
+ return $sym if $package =~ /^B::C(C?)::/;
my $fancyname;
if ( $filter and $filter =~ / :pad/ ) {
$fancyname = cstring($filter);
@@ -3675,7 +3677,8 @@ if (0) {
$gvcv = $gv->CV; # try again
}
if ( $$gvcv && $savefields & Save_CV
- and ref($gvcv->GV->EGV) ne 'B::SPECIAL') {
+ and ref($gvcv->GV->EGV) ne 'B::SPECIAL'
+ and !$skip_package{$package} ) {
my $origname =
cstring( $gvcv->GV->EGV->STASH->NAME . "::" . $gvcv->GV->EGV->NAME );
if ( $gvcv->XSUB and $name ne $origname ) { #XSUB CONSTSUB alias
Please sign in to comment.
Something went wrong with that request. Please try again.