1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fixed compilation of dead code after assignment property to non object

Fixes oss-fuzz #63558
This commit is contained in:
Dmitry Stogov
2023-10-25 09:42:07 +03:00
parent 894a7594aa
commit 3a8767b0d1
2 changed files with 21 additions and 0 deletions

View File

@@ -3462,6 +3462,10 @@ static void _zend_jit_merge_smart_branch_inputs(zend_jit_ctx *jit,
if (true_label == false_label && true_path && false_path) {
ir_MERGE_2(true_path, false_path);
_zend_jit_add_predecessor_ref(jit, true_label, jit->b, ir_END());
} else if (!true_path && !false_path) {
/* dead code */
true_path = ir_END();
_zend_jit_add_predecessor_ref(jit, true_label, jit->b, true_path);
} else {
if (true_path) {
_zend_jit_add_predecessor_ref(jit, true_label, jit->b, true_path);

View File

@@ -0,0 +1,17 @@
--TEST--
JIT ASSIGN_OBJ: Assign property to undefined value
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
functiOn foo() {
$obj->y = 42;
$obj && y;
}
?>
DONE
--EXPECT--
DONE