This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c:ck_eval: remove redundant null check
authorFather Chrysostomos <sprout@cpan.org>
Thu, 8 Aug 2013 21:17:08 +0000 (14:17 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 10 Aug 2013 02:28:34 +0000 (19:28 -0700)
op_first is never null when OPf_KIDS is set.

op.c

diff --git a/op.c b/op.c
index 1d72f27..f6d73a3 100644 (file)
--- a/op.c
+++ b/op.c
@@ -8408,12 +8408,9 @@ Perl_ck_eval(pTHX_ OP *o)
     PL_hints |= HINT_BLOCK_SCOPE;
     if (o->op_flags & OPf_KIDS) {
        SVOP * const kid = (SVOP*)cUNOPo->op_first;
+       assert(kid);
 
-       if (!kid) {
-           o->op_flags &= ~OPf_KIDS;
-           op_null(o);
-       }
-       else if (kid->op_type == OP_LINESEQ || kid->op_type == OP_STUB) {
+       if (kid->op_type == OP_LINESEQ || kid->op_type == OP_STUB) {
            LOGOP *enter;
 #ifdef PERL_MAD
            OP* const oldo = o;