Skip to content

Commit 3a3d836

Browse files
committed
Fixed IR construction
Fixes oss-fuzz #63857
1 parent a30d809 commit 3a3d836

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12123,6 +12123,8 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit,
1212312123
ir_MERGE_list(not_found_inputs);
1212412124
jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL);
1212512125
ir_END_list(end_inputs);
12126+
} else if (!end_inputs && jit->ctx.control) {
12127+
ir_END_list(end_inputs); /* dead code */
1212612128
}
1212712129
}
1212812130

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
JIT FETCH_DIM_R: 017
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 test() {
11+
$j = 0;
12+
for ($i = 0; $i < 20; $i++) {
13+
$obj->prop0 = $a =! --$a > $a =! --$a + $a = ($array[$a]);
14+
$obj->prop0 = $a =! --$a > $a =! --$a + $a = ($array[$a]);
15+
$array = array(312 > 0);
16+
$a = ($array[$a]);
17+
}
18+
}
19+
try {
20+
@test();
21+
} catch (Throwable $ex) {
22+
}
23+
?>
24+
DONE
25+
--EXPECT--
26+
DONE

0 commit comments

Comments
 (0)