1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  JIT: Fix incorrect reference counting inference
This commit is contained in:
Dmitry Stogov
2021-11-30 13:00:04 +03:00
2 changed files with 25 additions and 0 deletions

View File

@@ -2635,6 +2635,9 @@ static zend_always_inline int _zend_update_type_info(
} else if (opline->opcode == ZEND_ASSIGN_STATIC_PROP) {
/* Nothing to do */
} else {
if (opline->opcode == ZEND_ASSIGN_OP && ssa_op->result_def >= 0 && (tmp & MAY_BE_RC1)) {
tmp |= MAY_BE_RCN;
}
UPDATE_SSA_TYPE(tmp, ssa_op->op1_def);
}
if (ssa_op->result_def >= 0) {

View File

@@ -0,0 +1,22 @@
--TEST--
JIT ASSIGN_OP: 007 Arrays merging with return value
--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;
$a['b'] += 1;
}
}
test();
?>
DONE
--EXPECTF--
Warning: Undefined array key "b" in %sassign_op_007.php on line 6
DONE