This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_list(): re-order recursion in OP_LIST
authorDavid Mitchell <davem@iabyn.com>
Tue, 28 May 2019 08:57:04 +0000 (09:57 +0100)
committerDavid Mitchell <davem@iabyn.com>
Mon, 24 Jun 2019 10:40:06 +0000 (11:40 +0100)
Call list() on an OP_LIST's children, *after* potentially nulling out
the OP_LIST and an OP_PUSHMARK. This will make removing recursion
easier. Should be no functional difference.

op.c

diff --git a/op.c b/op.c
index 47017bc..8bc7cd9 100644 (file)
--- a/op.c
+++ b/op.c
@@ -2358,11 +2358,11 @@ Perl_list(pTHX_ OP *o)
        break;
 
     case OP_LIST:
-       listkids(o);
        if (cLISTOPo->op_first->op_type == OP_PUSHMARK) {
            op_null(cUNOPo->op_first); /* NULL the pushmark */
            op_null(o); /* NULL the list */
        }
+       listkids(o);
        break;
 
     case OP_LEAVE: