This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_op_sibling_splice(0 remove dead code
authorDavid Mitchell <davem@iabyn.com>
Fri, 22 Feb 2019 10:59:23 +0000 (10:59 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 22 Feb 2019 10:59:23 +0000 (10:59 +0000)
Spotted by Coverity.

We've already checkerd earlier on that at least one of parent and start
is non-null, so the line in question can never be reached. Turn it into
an assertion instead.

op.c

diff --git a/op.c b/op.c
index 8e7123d..6ca8948 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1442,8 +1442,7 @@ Perl_op_sibling_splice(OP *parent, OP *start, int del_count, OP* insert)
         OpMAYBESIB_set(start, insert, NULL);
     }
     else {
-        if (!parent)
-            goto no_parent;
+        assert(parent);
         cLISTOPx(parent)->op_first = insert;
         if (insert)
             parent->op_flags |= OPf_KIDS;