diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-04-15 20:01:58 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-04-15 20:01:58 +0000 |
commit | ec0b63d7653607317b5427af153e4a7e13388bee (patch) | |
tree | e7bfff01d2ac48b9c9f00d4d6ec6f89adc7813a4 /pp_ctl.c | |
parent | 941a98a017bebaf9418c346af5601481227ecf3c (diff) | |
download | perl-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.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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; |