mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fixed type inference
This commit is contained in:
commit
49256dcf6f
2 changed files with 26 additions and 1 deletions
|
@ -3083,7 +3083,13 @@ static int zend_update_type_info(const zend_op_array *op_array,
|
||||||
}
|
}
|
||||||
j = zend_ssa_next_use(ssa_ops, ssa_ops[i].result_def, j);
|
j = zend_ssa_next_use(ssa_ops, ssa_ops[i].result_def, j);
|
||||||
}
|
}
|
||||||
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
|
if ((tmp & MAY_BE_ARRAY)
|
||||||
|
&& (tmp & (MAY_BE_ARRAY_KEY_LONG|MAY_BE_ARRAY_KEY_STRING))) {
|
||||||
|
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
|
||||||
|
} else {
|
||||||
|
/* invalid key type */
|
||||||
|
UPDATE_SSA_TYPE(t1, ssa_ops[i].op1_def);
|
||||||
|
}
|
||||||
COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
|
COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
|
||||||
}
|
}
|
||||||
/* FETCH_LIST on a string behaves like FETCH_R on null */
|
/* FETCH_LIST on a string behaves like FETCH_R on null */
|
||||||
|
|
19
ext/opcache/tests/ssa_bug_009.phpt
Normal file
19
ext/opcache/tests/ssa_bug_009.phpt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
--TEST--
|
||||||
|
Incorrect type inference
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
class PHP_CodeCoverage
|
||||||
|
{
|
||||||
|
private function addUncoveredFilesFromWhitelist()
|
||||||
|
{
|
||||||
|
foreach ($uncoveredFiles as $uncoveredFile) {
|
||||||
|
for ($i = 1; $i <= $lines; $i++) {
|
||||||
|
$data[$uncoveredFile][$i] = PHP_CodeCoverage_Driver::LINE_NOT_EXECUTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
OK
|
||||||
|
--EXPECT--
|
||||||
|
OK
|
Loading…
Add table
Add a link
Reference in a new issue