rpeep() already optimises away consecutive nextstate ops. This commit
makes it do this even if there are 'noop' ops between them like null,
scope, lineseq.
This has a specific utility for the next commit, which will reorganise
the optree for subroutine signatures in a way which introduces a lineseq
between two nextstates.
this optimisation if the first NEXTSTATE has a label. */
if (!CopLABEL((COP*)o) && !PERLDB_NOOPT) {
OP *nextop = o->op_next;
this optimisation if the first NEXTSTATE has a label. */
if (!CopLABEL((COP*)o) && !PERLDB_NOOPT) {
OP *nextop = o->op_next;
- while (nextop && nextop->op_type == OP_NULL)
- nextop = nextop->op_next;
+ while (nextop) {
+ switch (nextop->op_type) {
+ case OP_NULL:
+ case OP_SCALAR:
+ case OP_LINESEQ:
+ case OP_SCOPE:
+ nextop = nextop->op_next;
+ continue;
+ }
+ break;
+ }
if (nextop && (nextop->op_type == OP_NEXTSTATE)) {
op_null(o);
if (nextop && (nextop->op_type == OP_NEXTSTATE)) {
op_null(o);