summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-06-17 09:33:26 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-06-17 13:32:58 -0700
commit65613fc23b9817bb12168505453c08d1b6b1baf2 (patch)
treeda12c4fcdf205c9b6f7d7938c65645110e0af64b
parentbc5a39a8e07f10d4372b4fc74847688f6c28d754 (diff)
downloadperl-65613fc23b9817bb12168505453c08d1b6b1baf2.tar.gz
Remove unnecessary code and tests
This test was relying on bug #91844. As that has been fixed (by com- mit 3ed94dc, which erroneously claimed to fix #81944), this test is not testing what it purports to test. Also as a result of that bug fix, it doesn’t matter if the TEMP flag is set, I can get rid of the SvTEMP_off. The only effects the TEMP flag can have now occur only when the refcount is 1, but since *_ holds a refcount and the mortals stack does as well, it’s going to be 2 unless someone undefs *_, in which case the callback won’t have any reference to it. If it tries to make a weak reference, doing so will turn TEMP off.
-rw-r--r--pp_ctl.c1
-rw-r--r--t/op/incfilter.t16
2 files changed, 2 insertions, 15 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 303e3565d6..04dd31b646 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -5295,7 +5295,6 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
I'm going to use a mortal in case the upstream filter croaks. */
upstream = ((SvOK(buf_sv) && sv_len(buf_sv)) || SvGMAGICAL(buf_sv))
? sv_newmortal() : buf_sv;
- SvTEMP_off(upstream);
SvUPGRADE(upstream, SVt_PV);
if (filter_has_file) {
diff --git a/t/op/incfilter.t b/t/op/incfilter.t
index 9db4f7d21b..582b691d82 100644
--- a/t/op/incfilter.t
+++ b/t/op/incfilter.t
@@ -13,7 +13,7 @@ use strict;
use Config;
use Filter::Util::Call;
-plan(tests => 145);
+plan(tests => 144);
unshift @INC, sub {
no warnings 'uninitialized';
@@ -228,22 +228,10 @@ for (0 .. 1) {
do $fh or die;
}
-# [perl #91880] $_ marked TEMP or having the wrong refcount inside a
+# [perl #91880] $_ having the wrong refcount inside a
{ # filter sub
local @INC; local $|;
unshift @INC, sub { sub { undef *_; --$| }};
do "dah";
pass '$_ has the right refcount inside a filter sub';
-
- my $temps = 0;
- @INC = sub { sub {
- my $temp = \sub{$_}->();
- $temps++ if $temp == \$_;
- $_ = "a" unless $|;
- return --$|
- }};
- local $^W;
- do "dah";
-
- is $temps, 0, '$_ is not marked TEMP';
}