summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/op.c b/op.c
index c755d1142e..1c88bba492 100644
--- a/op.c
+++ b/op.c
@@ -5971,7 +5971,8 @@ Perl_ck_fun(pTHX_ OP *o)
OP *newop = newGVOP(OP_GV, 0,
gv_fetchpv(SvPVx(((SVOP*)kid)->op_sv, n_a), TRUE,
SVt_PVIO) );
- if (kid == cLISTOPo->op_last)
+ if ((o->op_flags & OPf_KIDS) &&
+ kid == cLISTOPo->op_last)
cLISTOPo->op_last = newop;
op_free(kid);
kid = newop;