@@ -42,7 +42,15 @@ static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_bloc
42
42
43
43
if (b -> len != 0 ) {
44
44
zend_uchar opcode = opcodes [b -> start + b -> len - 1 ].opcode ;
45
- if (b -> successors_count == 1 ) {
45
+ if (opcode == ZEND_MATCH ) {
46
+ succ -> flags |= ZEND_BB_TARGET ;
47
+ } else if (opcode == ZEND_SWITCH_LONG || opcode == ZEND_SWITCH_STRING ) {
48
+ if (i == b -> successors_count - 1 ) {
49
+ succ -> flags |= ZEND_BB_FOLLOW | ZEND_BB_TARGET ;
50
+ } else {
51
+ succ -> flags |= ZEND_BB_TARGET ;
52
+ }
53
+ } else if (b -> successors_count == 1 ) {
46
54
if (opcode == ZEND_JMP ) {
47
55
succ -> flags |= ZEND_BB_TARGET ;
48
56
} else {
@@ -66,23 +74,13 @@ static void zend_mark_reachable(zend_op *opcodes, zend_cfg *cfg, zend_basic_bloc
66
74
}
67
75
}
68
76
}
69
- } else if (b -> successors_count == 2 ) {
77
+ } else {
78
+ ZEND_ASSERT (b -> successors_count == 2 );
70
79
if (i == 0 || opcode == ZEND_JMPZNZ ) {
71
80
succ -> flags |= ZEND_BB_TARGET ;
72
81
} else {
73
82
succ -> flags |= ZEND_BB_FOLLOW ;
74
83
}
75
- } else {
76
- ZEND_ASSERT (
77
- opcode == ZEND_SWITCH_LONG
78
- || opcode == ZEND_SWITCH_STRING
79
- || opcode == ZEND_MATCH
80
- );
81
- if (i == b -> successors_count - 1 ) {
82
- succ -> flags |= ZEND_BB_FOLLOW | ZEND_BB_TARGET ;
83
- } else {
84
- succ -> flags |= ZEND_BB_TARGET ;
85
- }
86
84
}
87
85
} else {
88
86
succ -> flags |= ZEND_BB_FOLLOW ;
0 commit comments