Skip to content

Commit 1ee38a3

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: Fix block_pass JMP[N]Z optimization
2 parents 9ab800e + 918dc23 commit 1ee38a3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Zend/Optimizer/block_pass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ static zend_always_inline zend_basic_block *get_next_block(const zend_cfg *cfg,
12281228
}
12291229
next_block++;
12301230
}
1231-
while (next_block->len == 0 && !(next_block->flags & ZEND_BB_PROTECTED)) {
1231+
while (next_block->len == 0 && !(next_block->flags & (ZEND_BB_TARGET|ZEND_BB_PROTECTED))) {
12321232
next_block = cfg->blocks + next_block->successors[0];
12331233
}
12341234
return next_block;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
OSS-Fuzz #472563272: Borked block_pass JMP[N]Z optimization
3+
--EXTENSIONS--
4+
opcache
5+
--INI--
6+
opcache.enable=1
7+
opcache.enable_cli=1
8+
--FILE--
9+
<?php
10+
false || (true ? true : false) || (false ? true : false) || true;
11+
?>
12+
===DONE===
13+
--EXPECT--
14+
===DONE===

0 commit comments

Comments
 (0)