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

Commit 76ecb00

Browse files
committed
Adjust CV::save logic for perl522 rurban#392
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
1 parent 56d1993 commit 76ecb00

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lib/B/C.pm

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ BEGIN {
345345
eval q[sub SVt_PVGV() {13}];
346346
eval q[sub CVf_WEAKOUTSIDE() { 0x0 }]; # unused
347347
}
348+
if ($] >= 5.008005) {
349+
B->import(qw(SVs_PADSTALE)); # added with 5.8.5
350+
} else {
351+
eval q[sub SVs_PADSTALE() {0x0}]; # unused
352+
}
348353
if ($] >= 5.010) {
349354
#require mro; # mro->import();
350355
# not exported:
@@ -4210,9 +4215,15 @@ sub B::CV::save {
42104215

42114216
# XXX how is ANON with CONST handled? CONST uses XSUBANY [GH #246]
42124217
if ($isconst and !is_phase_name($cvname) and
4213-
( ($PERL522 and !($CvFLAGS & (CVf_ANONCONST|CVf_CONST)))
4214-
or (!$PERL522 and !($CvFLAGS & CVf_ANON)) )
4215-
) # skip const magic blocks (Attribute::Handlers)
4218+
(
4219+
(
4220+
$PERL522
4221+
and !( $CvFLAGS & SVs_PADSTALE )
4222+
and !( $CvFLAGS & CVf_WEAKOUTSIDE )
4223+
and !( $fullname && $fullname =~ qr{^File::Glob::GLOB} and ( $CvFLAGS & (CVf_ANONCONST|CVf_CONST) ) )
4224+
)
4225+
or (!$PERL522 and !($CvFLAGS & CVf_ANON)) )
4226+
) # skip const magic blocks (Attribute::Handlers)
42164227
{
42174228
my $stash = $gv->STASH;
42184229
#warn sprintf("$cvstashname\::$cvname 0x%x -> XSUBANY", $CvFLAGS) if $debug{cv};

0 commit comments

Comments
 (0)