summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-15 20:01:58 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-15 20:01:58 +0000
commitec0b63d7653607317b5427af153e4a7e13388bee (patch)
treee7bfff01d2ac48b9c9f00d4d6ec6f89adc7813a4 /pp_ctl.c
parent941a98a017bebaf9418c346af5601481227ecf3c (diff)
downloadperl-ec0b63d7653607317b5427af153e4a7e13388bee.tar.gz
Fix a bug - the introduction of the caching code means that we should
initialise the SV upstream after it. assert that filter_sub is always non-null now. p4raw-id: //depot/perl@27820
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 1a0245a17f..d7d3fda0be 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4524,14 +4524,11 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
then clearly what it contains is already filtered by this filter, so we
don't want to pass it in a second time.
I'm going to use a mortal in case the upstream filter croaks. */
- SV *const upstream
- = ((SvOK(buf_sv) && sv_len(buf_sv)) || SvGMAGICAL(buf_sv))
- ? sv_newmortal() : buf_sv;
+ SV *upstream;
STRLEN got_len;
const char *got_p;
const char *prune_from = NULL;
- SvUPGRADE(upstream, SVt_PV);
/* I was having segfault trouble under Linux 2.2.5 after a
parse error occured. (Had to hack around it with a test
for PL_error_count == 0.) Solaris doesn't segfault --
@@ -4572,12 +4569,17 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
SvOK_off(cache);
}
}
+
+ upstream = ((SvOK(buf_sv) && sv_len(buf_sv)) || SvGMAGICAL(buf_sv))
+ ? sv_newmortal() : buf_sv;
+ SvUPGRADE(upstream, SVt_PV);
if (filter_has_file) {
status = FILTER_READ(idx+1, upstream, maxlen);
}
- if (filter_sub && status >= 0) {
+ assert(filter_sub);
+ if (status >= 0) {
dSP;
int count;