Skip to content

Commit 4453a27

Browse files
author
Todd Rinaldo
committed
Avoid FLAGS check for PADLISTS
1 parent bfb4c94 commit 4453a27

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/B/C/OverLoad/B/AV.pm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
package # do not index it
2-
B::AV;
1+
package # do not index it
2+
B::AV;
33

44
use B::C::Std;
55

@@ -33,6 +33,7 @@ sub section_sv ($av) {
3333
return svsect();
3434
}
3535

36+
# While PADLIST and PADNAMELIST inherit from AV, they use their own save logic.
3637
sub update_sv ( $av, $ix, $fullname, $args ) {
3738

3839
my $fill = $args->{fill};
@@ -70,7 +71,10 @@ sub skip_backref_sv ($sv) {
7071

7172
sub do_save ( $av, $fullname = undef, $cv = undef, $is_backref = 0 ) {
7273

73-
$av->FLAGS & 2048 and die sprintf( "Unexpected SVf_ROK found in %s\n", ref $av );
74+
# Skip FLAGS check for PAD modules that use AV as parent since calling flags for those is meaningless
75+
unless ( ref($av) =~ /^B::PAD(?:LIST|NAMELIST)$/ ) {
76+
$av->FLAGS & 2048 and die sprintf( "Unexpected SVf_ROK found in %s\n", ref $av );
77+
}
7478
$fullname ||= '';
7579

7680
my $fill = $av->fill();
@@ -164,7 +168,7 @@ sub do_save ( $av, $fullname = undef, $cv = undef, $is_backref = 0 ) {
164168
$acc .= "for (gcount=" . $1 . "; gcount<" . ( $1 + $count + 1 ) . "; gcount++) { *svp++ = $svpcast&sv_list[gcount]; };\n";
165169
$i += $count;
166170
}
167-
elsif ($use_av_undef_speedup
171+
elsif ( $use_av_undef_speedup
168172
&& defined $values[$i]
169173
&& defined $values[ $i + 1 ]
170174
&& defined $values[ $i + 2 ]

0 commit comments

Comments
 (0)