diff options
author | David Mitchell <davem@iabyn.com> | 2019-03-19 11:15:21 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-03-19 11:26:35 +0000 |
commit | 44b0aff01ba282b14dc62a1137996136282bc17a (patch) | |
tree | d52cc7d6edf53ed867a65de61aa8736433d24bbd | |
parent | 170c919fc4986a85062e9292e4cfed24771d2224 (diff) | |
download | perl-44b0aff01ba282b14dc62a1137996136282bc17a.tar.gz |
op_free() remove redundant !kid test
and replace with an assert.
If an op has the OPf_KIDS flag, then cUNOPo->op_first must be non-null.
So testing for !kid doesn't do much, especially as on the previous line
we dereference it anyway.
-rw-r--r-- | op.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -884,9 +884,10 @@ Perl_op_free(pTHX_ OP *o) if (o->op_flags & OPf_KIDS) { OP *kid, *nextkid; + assert(cUNOPo->op_first); /* OPf_KIDS implies op_first non-null */ for (kid = cUNOPo->op_first; kid; kid = nextkid) { nextkid = OpSIBLING(kid); /* Get before next freeing kid */ - if (!kid || kid->op_type == OP_FREED) + if (kid->op_type == OP_FREED) /* During the forced freeing of ops after compilation failure, kidops may be freed before their parents. */ |