summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-25 22:15:02 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-25 22:15:02 +0000
commit09e8efccba1f47d53c182ecd6161dfcbbbc53b0f (patch)
treec8f0f8ed410f925b822439ee6c3cc69aaf4c7b20 /pp_hot.c
parent2590d28705872a65d11745576d64aa79a6c9cdfe (diff)
downloadperl-09e8efccba1f47d53c182ecd6161dfcbbbc53b0f.tar.gz
Fix readline in list mode to tell rest of world that it has
things on the stack. Otherwise if perl code gets invoked underneath it it scribbles over results-so-far. (Why TIEHANDLE has not tripped on this is a mystery.) p4raw-id: //depot/perlio@9351
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 58874a87b9..7a6ad3224d 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1511,6 +1511,7 @@ Perl_do_readline(pTHX)
|| (IoFLAGS(io) & IOf_NOLINE) || !RsSNARF(rs))
for (;;) {
+ PUTBACK;
if (!sv_gets(sv, fp, offset)
&& (type == OP_GLOB || SNARF_EOF(gimme, PL_rs, io, sv)))
{
@@ -1531,6 +1532,7 @@ Perl_do_readline(pTHX)
}
if (gimme == G_SCALAR) {
(void)SvOK_off(TARG);
+ SPAGAIN;
PUSHTARG;
}
MAYBE_TAINT_LINE(io, sv);
@@ -1540,6 +1542,7 @@ Perl_do_readline(pTHX)
IoLINES(io)++;
IoFLAGS(io) |= IOf_NOLINE;
SvSETMAGIC(sv);
+ SPAGAIN;
XPUSHs(sv);
if (type == OP_GLOB) {
char *tmps;