Skip to content

Commit 7434909

Browse files
committed
Fix type inference
Fixes oss-fuzz #44407
1 parent 0d6b173 commit 7434909

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

ext/opcache/Optimizer/zend_inference.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2625,6 +2625,9 @@ static zend_always_inline int _zend_update_type_info(
26252625
if (t1 & MAY_BE_STRING) {
26262626
tmp |= MAY_BE_STRING | MAY_BE_NULL;
26272627
}
2628+
if (t1 & MAY_BE_OBJECT) {
2629+
tmp |= (MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF);
2630+
}
26282631
if (t1 & (MAY_BE_ARRAY|MAY_BE_FALSE|MAY_BE_NULL|MAY_BE_UNDEF)) {
26292632
tmp |= (OP1_DATA_INFO() & (MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF));
26302633

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
JIT ASSIGN_DIM: 012
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($key) {
11+
$ao = new ArrayObject();
12+
$ao[$key] = 1 < $ao['321'] = 2;
13+
}
14+
test('0');
15+
?>
16+
DONE
17+
--EXPECTF--
18+
DONE

0 commit comments

Comments
 (0)