This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The optree builder was looping when constructing the ops
[perl5.git] / op.c
diff --git a/op.c b/op.c
index b38c892..46cc07b 100644 (file)
--- a/op.c
+++ b/op.c
@@ -5430,7 +5430,7 @@ Perl_ck_grep(pTHX_ OP *o)
        OP* k;
        o = ck_sort(o);
         kid = cLISTOPo->op_first->op_sibling;
-       for (k = cLISTOPo->op_first->op_sibling->op_next; k; k = k->op_next) {
+       for (k = cUNOPx(kid)->op_first; k; k = k->op_next) {
            kid = k;
        }
        kid->op_next = (OP*)gwop;