From 44de5490cef8e95fb52b4a4e4747646f6550121e Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Wed, 9 Dec 2015 14:27:18 +0000 Subject: [PATCH] rpeep: maintain chain when handling for(reverse..) There's code in rpeep() that eliminates the reverse op from for (reverse ....) {} and just flags the enteriter as needing to reverse its args. This code didn't leave oldoldop -> oldop -> o as a consistent chain of adjacent op_next ops. --- op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/op.c b/op.c index 07a9121..30595b7 100644 --- a/op.c +++ b/op.c @@ -14154,6 +14154,11 @@ Perl_rpeep(pTHX_ OP *o) op_null(o); enter->op_private |= OPpITER_REVERSED; iter->op_private |= OPpITER_REVERSED; + + oldoldop = NULL; + oldop = ourlast; + o = oldop->op_next; + goto redo; break; } -- 1.8.3.1