Subject: | [PATCH] Another CvPADLIST patch |
I missed this failure mode in my previous patch, because PadWalker’s own tests did not trigger. This is causing Parse::MediaWikiDump to fail. (See <https://rt.perl.org/Ticket/Display.html?id=123462>.)
Subject: | open_wApldkge.txt |
PadWalker-2.0-90BVKG/PadWalker.o differ
diff -rup PadWalker-2.0-90BVKG-orig/PadWalker.xs PadWalker-2.0-90BVKG/PadWalker.xs
--- PadWalker-2.0-90BVKG-orig/PadWalker.xs 2014-12-12 02:25:03.000000000 -0800
+++ PadWalker-2.0-90BVKG/PadWalker.xs 2014-12-20 09:59:51.000000000 -0800
@@ -392,7 +392,7 @@ get_closed_over(CV *cv, HV *hash, HV *in
PADNAMELIST *pad_namelist;
PAD *pad_vallist;
- if (!CvPADLIST(cv)) {
+ if (CvISXSUB(cv) || !CvPADLIST(cv)) {
return;
}
diff -rup PadWalker-2.0-90BVKG-orig/t/closure.t PadWalker-2.0-90BVKG/t/closure.t
--- PadWalker-2.0-90BVKG-orig/t/closure.t 2010-04-02 14:08:06.000000000 -0700
+++ PadWalker-2.0-90BVKG/t/closure.t 2014-12-20 10:00:17.000000000 -0800
@@ -1,7 +1,7 @@
use strict; use warnings;
use PadWalker 'closed_over', 'set_closed_over';
-print "1..29\n";
+print "1..30\n";
my $x=2;
my $h = closed_over (my $sub = sub {my $y = $x++});
@@ -104,3 +104,6 @@ print (keys %$indices == 0 ? "ok 16\n" :
print( $@ ? "not ok 29\n" : "ok 29\n" );
}
+
+$h = closed_over(\&utf8::encode);
+print +(%$h == 0 ? "ok 30" : "not ok 30") . " - closed_over on XSUB\n";