summaryrefslogtreecommitdiff
path: root/dist/Safe
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-03-31 13:50:04 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-04-03 08:46:03 -0700
commitd1718a7cf54f01c3c9d449a1ea96c9bba32d1126 (patch)
treee8589072ca6d679a871b14f215413bc51da4a517 /dist/Safe
parent6331a2f5f6ee89f25cb6803c1d9ef97d6d1799e5 (diff)
downloadperl-d1718a7cf54f01c3c9d449a1ea96c9bba32d1126.tar.gz
[perl #111462] Move strict hints from %^H to $^H
With commit b50b20584, strict.pm starting putting hints in %^H to indicate that strict mode has been enabled or disabled explicitly, so version declarations should not change the setting. This causes ‘Unbalanced string table refcount’ warnings when Safe.pm encounters prohibited ops. This happens because ops are leaking when those ops point to HEKs (in the internal form that %^H takes when attached to ops). This commit moves those new strict hints into $^H, to avoid those warnings. This does simply paper over the real problem (leaked ops), but at least it gets the warnings back down to the 5.14 amount. Because of the new hints in $^H, B::Concise has been updated to account for them, and so have all its tests. I modified OptreeCheck to avoid setting the hints with ‘no strict;’, as that resulted in slightly fewer changes to the tests. It will also result in fewer changes to the tests in future. Two B::Deparse tests started failing due to %^H not being localised. Apparently there is a bug somewhere (in perl, Deparse.pm or deparse.t) that got triggered as a result. In fact, one of the tests exhibited *two* bugs. But for now, I’ve simply added a workaround to the two tests so they don’t trigger those bugs (which bugs will have to wait till after 5.16).
Diffstat (limited to 'dist/Safe')
-rw-r--r--dist/Safe/t/safeops.t10
1 files changed, 9 insertions, 1 deletions
diff --git a/dist/Safe/t/safeops.t b/dist/Safe/t/safeops.t
index 885b0db150..8edb2232c9 100644
--- a/dist/Safe/t/safeops.t
+++ b/dist/Safe/t/safeops.t
@@ -40,7 +40,7 @@ while (<$fh>) {
}
close $fh;
-plan(tests => scalar @op + 1);
+plan(tests => scalar @op + 2);
sub testop {
my ($op, $opname, $code) = @_;
@@ -73,6 +73,14 @@ foreach (@op) {
),
qr/Unbalanced/,
'No Unbalanced warnings when disallowing ops';
+ unlike
+ runperl(
+ switches => [ '-MSafe', '-w' ],
+ prog => 'Safe->new->reval(q(use strict), 1)',
+ stderr => 1,
+ ),
+ qr/Unbalanced/,
+ 'No Unbalanced warnings when disallowing ops';
}
# things that begin with SKIP are skipped, for various reasons (notably