mirror of
https://github.com/php/php-src.git
synced 2025-01-24 04:33:39 +08:00
Merge branch 'PHP-8.1'
* PHP-8.1: Start new block after loop free
This commit is contained in:
commit
d1aff29a04
@ -437,6 +437,9 @@ ZEND_API void zend_build_cfg(zend_arena **arena, const zend_op_array *op_array,
|
||||
case ZEND_FE_FREE:
|
||||
if (zend_optimizer_is_loop_var_free(opline)) {
|
||||
BB_START(i);
|
||||
if (i + 1 < op_array->last) {
|
||||
BB_START(i + 1);
|
||||
}
|
||||
flags |= ZEND_FUNC_FREE_LOOP_VAR;
|
||||
}
|
||||
break;
|
||||
|
18
Zend/tests/match/045.phpt
Normal file
18
Zend/tests/match/045.phpt
Normal file
@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Corrupted CFG due to unreachable free with match
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
var_dump(match(x){});
|
||||
match(y){
|
||||
3, 4 => 5,
|
||||
};
|
||||
}
|
||||
try {
|
||||
test();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Undefined constant "x"
|
Loading…
Reference in New Issue
Block a user