Subject: | Fix to work with B::PADLIST |
In trying to fix a perl bug, I have found the need to stop padlists from being AVs.
See the branch I pushed to
<http://perl5.git.perl.org/perl.git/shortlog/refs/heads/sprout/padlist>. (It’s not finished yet.
It still needs docs.)
This breaks B::Debug, because svref_2object(sub{})->PADLIST now returns an object of type
B::PADLIST.
Attached is a patch to fix it.
I eagerly await a new release, so I can merge this to blead. :-)
Subject: | open_esbBLVyO.txt |
diff -rup B-Debug-1.17-DsWHyx-orig/Debug.pm B-Debug-1.17-DsWHyx/Debug.pm
--- B-Debug-1.17-DsWHyx-orig/Debug.pm 2011-11-25 13:52:30.000000000 -0800
+++ B-Debug-1.17-DsWHyx/Debug.pm 2012-08-16 16:57:28.000000000 -0700
@@ -285,11 +285,16 @@ EOT
sub B::AV::debug {
my ($av) = @_;
$av->B::SV::debug;
+ _array_debug($av);
+}
+
+sub _array_debug {
+ my ($av) = @_;
# tied arrays may leave out FETCHSIZE
my (@array) = eval { $av->ARRAY; };
print "\tARRAY\t\t(", join(", ", map("0x" . $$_, @array)), ")\n";
my $fill = eval { scalar(@array) };
- if ($Config{'useithreads'}) {
+ if ($Config{'useithreads'} && class($av) ne 'PADLIST') {
printf <<'EOT', $fill, $av->MAX, $av->OFF;
FILL %d
MAX %d
@@ -353,6 +358,15 @@ sub B::SPECIAL::debug {
print exists $specialsv_name[$i] ? $specialsv_name[$i] : "", "\n";
}
+sub B::PADLIST::debug {
+ my ($padlist) = @_;
+ printf <<'EOT', class($padlist), $$padlist, $padlist->REFCNT;
+%s (0x%x)
+ REFCNT %d
+EOT
+ _array_debug($padlist);
+}
+
sub compile {
my $order = shift;
B::clearsym();