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:
@@ -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);
|
||||
|
||||
17
ext/opcache/tests/jit/assign_obj_004.phpt
Normal file
17
ext/opcache/tests/jit/assign_obj_004.phpt
Normal 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
|
||||
Reference in New Issue
Block a user