Skip to content

Commit 7921e08

Browse files
committed
Disable eliminatin of empty basic block with multiple predecessors
1 parent fec1bd0 commit 7921e08

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

ext/opcache/Optimizer/dfa_pass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ static void zend_ssa_replace_control_link(zend_op_array *op_array, zend_ssa *ssa
578578

579579
static void zend_ssa_unlink_block(zend_op_array *op_array, zend_ssa *ssa, zend_basic_block *block, int block_num)
580580
{
581-
if (block->predecessors_count && ssa->blocks[block_num].phis == NULL) {
581+
if (block->predecessors_count == 1 && ssa->blocks[block_num].phis == NULL) {
582582
int *predecessors, i;
583583

584584
ZEND_ASSERT(block->successors_count == 1);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Incorrect empty basic block elimination
3+
--SKIPIF--
4+
<?php require_once('skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
class A {
8+
public static function test($args = array()) {
9+
if (!function_exists( 'stream_socket_client'))
10+
return false;
11+
12+
$is_ssl = isset( $args['ssl'] ) && $args['ssl'];
13+
14+
if ($is_ssl) {
15+
if (!extension_loaded( 'openssl'))
16+
return false;
17+
if (!function_exists('openssl_x509_parse'))
18+
return false;
19+
}
20+
21+
return apply_filters('use_streams_transport', true, $args);
22+
}
23+
}
24+
?>
25+
OK
26+
--EXPECT--
27+
OK

0 commit comments

Comments
 (0)