Purify: Array bounds read: o->op_last was accessed
Jarkko Hietaniemi [Sat, 23 Mar 2002 00:48:23 +0000 (00:48 +0000)]
for unops (via newUNOP() and ck_eof()).
(analysis okay, patch bad: see #15439)

p4raw-id: //depot/perl@15434

op.c

diff --git a/op.c b/op.c
index c755d11..1c88bba 100644 (file)
--- 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;