if (next < end && next == blocks + b->successors[0]) {
/* JMP to the next block - strip it */
MAKE_NOP(opline);
- b->end--;
+ if (b->end == 0) {
+ b->start++;
+ } else {
+ b->end--;
+ }
}
} else if (b->start == b->end && opline->opcode == ZEND_NOP) {
/* skip empty block */
op_array->last = len;
for (b = blocks; b < end; b++) {
- if (!(b->flags & ZEND_BB_REACHABLE)) {
+ if (!(b->flags & ZEND_BB_REACHABLE) || b->start > b->end) {
continue;
}
opline = op_array->opcodes + b->end;