Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Adjust CV::save logic for perl522 rurban#392
Browse files Browse the repository at this point in the history
This is fixing the compilation of several core tests
and introduced only one single regression which unicode sub.

SVs_PADSTALE was introduced in perl 5.8.5
  • Loading branch information
atoomic committed Sep 16, 2016
1 parent 56d1993 commit 76ecb00
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/B/C.pm
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ BEGIN {
eval q[sub SVt_PVGV() {13}];
eval q[sub CVf_WEAKOUTSIDE() { 0x0 }]; # unused
}
if ($] >= 5.008005) {
B->import(qw(SVs_PADSTALE)); # added with 5.8.5
} else {
eval q[sub SVs_PADSTALE() {0x0}]; # unused
}
if ($] >= 5.010) {
#require mro; # mro->import();
# not exported:
Expand Down Expand Up @@ -4210,9 +4215,15 @@ sub B::CV::save {

# XXX how is ANON with CONST handled? CONST uses XSUBANY [GH #246]
if ($isconst and !is_phase_name($cvname) and
( ($PERL522 and !($CvFLAGS & (CVf_ANONCONST|CVf_CONST)))
or (!$PERL522 and !($CvFLAGS & CVf_ANON)) )
) # skip const magic blocks (Attribute::Handlers)
(
(
$PERL522
and !( $CvFLAGS & SVs_PADSTALE )
and !( $CvFLAGS & CVf_WEAKOUTSIDE )
and !( $fullname && $fullname =~ qr{^File::Glob::GLOB} and ( $CvFLAGS & (CVf_ANONCONST|CVf_CONST) ) )
)
or (!$PERL522 and !($CvFLAGS & CVf_ANON)) )
) # skip const magic blocks (Attribute::Handlers)
{
my $stash = $gv->STASH;
#warn sprintf("$cvstashname\::$cvname 0x%x -> XSUBANY", $CvFLAGS) if $debug{cv};
Expand Down

0 comments on commit 76ecb00

Please sign in to comment.