diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-03-31 13:50:04 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-04-03 08:46:03 -0700 |
commit | d1718a7cf54f01c3c9d449a1ea96c9bba32d1126 (patch) | |
tree | e8589072ca6d679a871b14f215413bc51da4a517 /ext/B/t/optree_specials.t | |
parent | 6331a2f5f6ee89f25cb6803c1d9ef97d6d1799e5 (diff) | |
download | perl-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 'ext/B/t/optree_specials.t')
-rw-r--r-- | ext/B/t/optree_specials.t | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/ext/B/t/optree_specials.t b/ext/B/t/optree_specials.t index c6e41995d0..5af6bd2501 100644 --- a/ext/B/t/optree_specials.t +++ b/ext/B/t/optree_specials.t @@ -49,10 +49,10 @@ checkOptree ( name => 'BEGIN', # BEGIN 1: # a <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->a -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ ->2 +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->2 # 3 <1> require sK/1 ->4 # 2 <$> const[PV "strict.pm"] s/BARE ->3 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ ->5 +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->5 # - <@> lineseq K ->- # - <0> null ->5 # 9 <1> entersub[t1] KS*/TARG,2 ->a @@ -63,10 +63,10 @@ checkOptree ( name => 'BEGIN', # BEGIN 2: # k <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq K ->k -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ ->c +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->c # d <1> require sK/1 ->e # c <$> const[PV "strict.pm"] s/BARE ->d -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ ->f +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->f # - <@> lineseq K ->- # - <0> null ->f # j <1> entersub[t1] KS*/TARG,2 ->k @@ -77,10 +77,10 @@ checkOptree ( name => 'BEGIN', # BEGIN 3: # u <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->u -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ ->m +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->m # n <1> require sK/1 ->o # m <$> const[PV "warnings.pm"] s/BARE ->n -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ ->p +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->p # - <@> lineseq K ->- # - <0> null ->p # t <1> entersub[t1] KS*/TARG,2 ->u @@ -99,10 +99,10 @@ EOT_EOT # BEGIN 1: # a <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->a -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ ->2 +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->2 # 3 <1> require sK/1 ->4 # 2 <$> const(PV "strict.pm") s/BARE ->3 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ ->5 +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ ->5 # - <@> lineseq K ->- # - <0> null ->5 # 9 <1> entersub[t1] KS*/TARG,2 ->a @@ -113,10 +113,10 @@ EOT_EOT # BEGIN 2: # k <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq K ->k -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ ->c +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->c # d <1> require sK/1 ->e # c <$> const(PV "strict.pm") s/BARE ->d -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ ->f +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ ->f # - <@> lineseq K ->- # - <0> null ->f # j <1> entersub[t1] KS*/TARG,2 ->k @@ -127,10 +127,10 @@ EOT_EOT # BEGIN 3: # u <1> leavesub[1 ref] K/REFC,1 ->(end) # - <@> lineseq KP ->u -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ ->m +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->m # n <1> require sK/1 ->o # m <$> const(PV "warnings.pm") s/BARE ->n -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ ->p +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ ->p # - <@> lineseq K ->- # - <0> null ->p # t <1> entersub[t1] KS*/TARG,2 ->u @@ -248,10 +248,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 2 <$> const[PV "strict.pm"] s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 5 <0> pushmark s # 6 <$> const[PV "strict"] sM # 7 <$> const[PV "refs"] sM @@ -259,10 +259,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # c <$> const[PV "strict.pm"] s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # f <0> pushmark s # g <$> const[PV "strict"] sM # h <$> const[PV "refs"] sM @@ -270,10 +270,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # m <$> const[PV "warnings.pm"] s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # p <0> pushmark s # q <$> const[PV "warnings"] sM # r <$> const[PV "qw"] sM @@ -307,10 +307,10 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # 1e <1> leavesub[1 ref] K/REFC,1 EOT_EOT # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 2 <$> const(PV "strict.pm") s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 5 <0> pushmark s # 6 <$> const(PV "strict") sM # 7 <$> const(PV "refs") sM @@ -318,10 +318,10 @@ EOT_EOT # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # c <$> const(PV "strict.pm") s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # f <0> pushmark s # g <$> const(PV "strict") sM # h <$> const(PV "refs") sM @@ -329,10 +329,10 @@ EOT_EOT # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # m <$> const(PV "warnings.pm") s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # p <0> pushmark s # q <$> const(PV "warnings") sM # r <$> const(PV "qw") sM @@ -377,10 +377,10 @@ checkOptree ( name => 'regression test for patch 25352', @warnings_todo, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 2 <$> const[PV "strict.pm"] s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 5 <0> pushmark s # 6 <$> const[PV "strict"] sM # 7 <$> const[PV "refs"] sM @@ -388,10 +388,10 @@ checkOptree ( name => 'regression test for patch 25352', # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # c <$> const[PV "strict.pm"] s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # f <0> pushmark s # g <$> const[PV "strict"] sM # h <$> const[PV "refs"] sM @@ -399,10 +399,10 @@ checkOptree ( name => 'regression test for patch 25352', # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # m <$> const[PV "warnings.pm"] s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # p <0> pushmark s # q <$> const[PV "warnings"] sM # r <$> const[PV "qw"] sM @@ -411,10 +411,10 @@ checkOptree ( name => 'regression test for patch 25352', # u <1> leavesub[1 ref] K/REFC,1 EOT_EOT # BEGIN 1: -# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 1 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 2 <$> const(PV "strict.pm") s/BARE # 3 <1> require sK/1 -# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:%,*,&,{,$ +# 4 <;> nextstate(B::Concise -275 Concise.pm:356) v:x*,x&,x$,*,&,{,$ # 5 <0> pushmark s # 6 <$> const(PV "strict") sM # 7 <$> const(PV "refs") sM @@ -422,10 +422,10 @@ EOT_EOT # 9 <1> entersub[t1] KS*/TARG,2 # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: -# b <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# b <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # c <$> const(PV "strict.pm") s/BARE # d <1> require sK/1 -# e <;> nextstate(B::Concise -265 Concise.pm:367) v:%,*,&,$ +# e <;> nextstate(B::Concise -265 Concise.pm:367) v:x*,x&,x$,*,&,$ # f <0> pushmark s # g <$> const(PV "strict") sM # h <$> const(PV "refs") sM @@ -433,10 +433,10 @@ EOT_EOT # j <1> entersub[t1] KS*/TARG,2 # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: -# l <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# l <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # m <$> const(PV "warnings.pm") s/BARE # n <1> require sK/1 -# o <;> nextstate(B::Concise -254 Concise.pm:386) v:%,*,&,{,$ +# o <;> nextstate(B::Concise -254 Concise.pm:386) v:x*,x&,x$,*,&,{,$ # p <0> pushmark s # q <$> const(PV "warnings") sM # r <$> const(PV "qw") sM |