From 58e8b84f23648f1da33b7d173f437a8bcae6e548 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Wed, 9 Dec 2015 13:51:22 +0000 Subject: [PATCH] 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. --- op.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 1.8.3.1