Skip to content

Commit 3a8767b

Browse files
committed
Fixed compilation of dead code after assignment property to non object
Fixes oss-fuzz #63558
1 parent 894a759 commit 3a8767b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

ext/opcache/jit/zend_jit_ir.c

+4
Original file line numberDiff line numberDiff line change
@@ -3462,6 +3462,10 @@ static void _zend_jit_merge_smart_branch_inputs(zend_jit_ctx *jit,
34623462
if (true_label == false_label && true_path && false_path) {
34633463
ir_MERGE_2(true_path, false_path);
34643464
_zend_jit_add_predecessor_ref(jit, true_label, jit->b, ir_END());
3465+
} else if (!true_path && !false_path) {
3466+
/* dead code */
3467+
true_path = ir_END();
3468+
_zend_jit_add_predecessor_ref(jit, true_label, jit->b, true_path);
34653469
} else {
34663470
if (true_path) {
34673471
_zend_jit_add_predecessor_ref(jit, true_label, jit->b, true_path);
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
JIT ASSIGN_OBJ: Assign property to undefined value
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
functiOn foo() {
11+
$obj->y = 42;
12+
$obj && y;
13+
}
14+
?>
15+
DONE
16+
--EXPECT--
17+
DONE

0 commit comments

Comments
 (0)