This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58e8b84
)
rpeep: maintain chain when handling for(reverse..)
author
David Mitchell
<davem@iabyn.com>
Wed, 9 Dec 2015 14:27:18 +0000
(14:27 +0000)
committer
David Mitchell
<davem@iabyn.com>
Wed, 9 Dec 2015 14:29:47 +0000
(14:29 +0000)
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
patch
|
blob
|
blame
|
history
diff --git
a/op.c
b/op.c
index
07a9121
..
30595b7
100644
(file)
--- 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;
}