From: David Mitchell Date: Wed, 9 Dec 2015 13:51:22 +0000 (+0000) Subject: rpeep: maintain chain when del extra nextstates X-Git-Tag: v5.23.6~101^2~2 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/58e8b84f23648f1da33b7d173f437a8bcae6e548 rpeep: maintain chain when del extra nextstates There's code in rpeep() that eliminates duplicate nextstate ops. E.g. FOO -> NEXTSTATE1 -> NULL -> ... -> NULL -> NEXTSTATE2 -> ... becomes FOO --------------------------------------> NEXTSTATE2 -> ... This code didn't leave oldoldop -> oldop -> o as a consistent chain of adjacent op_next ops. --- diff --git a/op.c b/op.c index bc6263b..07a9121 100644 --- a/op.c +++ b/op.c @@ -13448,9 +13448,10 @@ Perl_rpeep(pTHX_ OP *o) op_null(o); if (oldop) oldop->op_next = nextop; + o = nextop; /* Skip (old)oldop assignment since the current oldop's op_next already points to the next op. */ - continue; + goto redo; } } break;