This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #111462] Move strict hints from %^H to $^H
authorFather Chrysostomos <sprout@cpan.org>
Sat, 31 Mar 2012 20:50:04 +0000 (13:50 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 3 Apr 2012 15:46:03 +0000 (08:46 -0700)
commitd1718a7cf54f01c3c9d449a1ea96c9bba32d1126
treee8589072ca6d679a871b14f215413bc51da4a517
parent6331a2f5f6ee89f25cb6803c1d9ef97d6d1799e5
[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).
14 files changed:
dist/B-Deparse/Deparse.pm
dist/B-Deparse/t/deparse.t
dist/Safe/t/safeops.t
ext/B/B/Concise.pm
ext/B/t/OptreeCheck.pm
ext/B/t/f_map.t
ext/B/t/f_sort.t
ext/B/t/optree_check.t
ext/B/t/optree_constants.t
ext/B/t/optree_samples.t
ext/B/t/optree_specials.t
lib/strict.pm
op.c
perl.h