Skip to content

Commit 56a5d0b

Browse files
committed
Fixed CFG construction for SWITCH opcodes
1 parent f775516 commit 56a5d0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/opcache/Optimizer/zend_cfg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_bloc
7474
}
7575
} else {
7676
ZEND_ASSERT(opcode == ZEND_SWITCH_LONG || opcode == ZEND_SWITCH_STRING);
77-
if (i == b->successors_count) {
78-
succ->flags |= ZEND_BB_FOLLOW;
77+
if (i == b->successors_count - 1) {
78+
succ->flags |= ZEND_BB_FOLLOW | ZEND_BB_TARGET;
7979
} else {
8080
succ->flags |= ZEND_BB_TARGET;
8181
}

0 commit comments

Comments
 (0)