mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fix refcount inferemce ($a += $a returns old array with RCN)
This commit is contained in:
commit
ebb7b173b0
@ -2636,7 +2636,7 @@ static zend_always_inline zend_result _zend_update_type_info(
|
||||
ssa, opline->extended_value, t1, t2,
|
||||
opline->opcode == ZEND_ASSIGN_OP ? ssa_op->op1_def : -1, optimization_level);
|
||||
if (tmp & (MAY_BE_STRING|MAY_BE_ARRAY)) {
|
||||
tmp |= MAY_BE_RC1;
|
||||
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
||||
}
|
||||
if (tmp & (MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
|
||||
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
|
||||
|
22
ext/opcache/tests/jit/assign_op_008.phpt
Normal file
22
ext/opcache/tests/jit/assign_op_008.phpt
Normal file
@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
JIT ASSIGN_OP: 008 Arrays merging with itself
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
$a = [];
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
$a + $a += $a;
|
||||
$a['b'] += 1;
|
||||
}
|
||||
}
|
||||
test();
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: Undefined array key "b" in %sassign_op_008.php on line 6
|
||||
DONE
|
Loading…
Reference in New Issue
Block a user