mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
Merge branch 'PHP-7.2'
* PHP-7.2: Fixed bug in type inference
This commit is contained in:
commit
88e257c152
2 changed files with 21 additions and 1 deletions
|
@ -3109,7 +3109,8 @@ static int zend_update_type_info(const zend_op_array *op_array,
|
||||||
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
|
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
|
||||||
} else {
|
} else {
|
||||||
/* invalid key type */
|
/* invalid key type */
|
||||||
UPDATE_SSA_TYPE(t1, ssa_ops[i].op1_def);
|
tmp = (tmp & (MAY_BE_RC1|MAY_BE_RCN)) | (t1 & ~(MAY_BE_RC1|MAY_BE_RCN));
|
||||||
|
UPDATE_SSA_TYPE(tmp, 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);
|
||||||
}
|
}
|
||||||
|
|
19
ext/opcache/tests/ssa_bug_011.phpt
Normal file
19
ext/opcache/tests/ssa_bug_011.phpt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
--TEST--
|
||||||
|
Type inference warning
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function renderRawGraph(array $parents) {
|
||||||
|
$graph = array();
|
||||||
|
foreach ($parents as $p) {
|
||||||
|
foreach ($graph as $v) {
|
||||||
|
$graph[$v]['line'] = 1;
|
||||||
|
}
|
||||||
|
$graph[] = array(
|
||||||
|
'line' => 1,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
OK
|
||||||
|
--EXPECT--
|
||||||
|
OK
|
Loading…
Add table
Add a link
Reference in a new issue