From 5668452f0dfcb2591dfb8da07389b99e8823a280 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 23 Nov 2011 23:32:30 -0800 Subject: [PATCH] Call FETCH once for rcatline --- pp_hot.c | 6 +++--- t/op/tie_fetch_count.t | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pp_hot.c b/pp_hot.c index eb8fe4f..70eb5a1 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1614,12 +1614,12 @@ Perl_do_readline(pTHX) mg_get(sv); if (SvROK(sv)) { if (type == OP_RCATLINE) - SvPV_force_nolen(sv); + SvPV_force_nomg_nolen(sv); else sv_unref(sv); } else if (isGV_with_GP(sv)) { - SvPV_force_nolen(sv); + SvPV_force_nomg_nolen(sv); } SvUPGRADE(sv, SVt_PV); tmplen = SvLEN(sv); /* remember if already alloced */ @@ -1632,7 +1632,7 @@ Perl_do_readline(pTHX) offset = 0; if (type == OP_RCATLINE && SvOK(sv)) { if (!SvPOK(sv)) { - SvPV_force_nolen(sv); + SvPV_force_nomg_nolen(sv); } offset = SvCUR(sv); } diff --git a/t/op/tie_fetch_count.t b/t/op/tie_fetch_count.t index 3198105..d9d4989 100644 --- a/t/op/tie_fetch_count.t +++ b/t/op/tie_fetch_count.t @@ -7,7 +7,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; - plan (tests => 295); + plan (tests => 298); } use strict; @@ -121,6 +121,12 @@ $dummy = atan2 $var, 1 ; check_count 'atan2'; # Readline/glob tie my $var0, "main", \*DATA; $dummy = <$var0> ; check_count ''; +$var = \1; +$var .= ; check_count '$tiedref .= '; +$var = "tied"; +$var .= ; check_count '$tiedstr .= '; +$var = *foo; +$var .= ; check_count '$tiedglob .= '; $dummy = <${var}> ; check_count ''; # File operators -- 2.7.4