Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fixed incorrect reference counter inference
This commit is contained in:
Dmitry Stogov 2021-11-08 20:54:45 +03:00
commit 9bd490dc33
3 changed files with 24 additions and 1 deletions

View File

@ -2549,7 +2549,7 @@ static zend_always_inline int _zend_update_type_info(
}
if (t1 & (MAY_BE_RC1|MAY_BE_RCN)) {
tmp |= (t1 & (MAY_BE_RC1|MAY_BE_RCN));
if (opline->op1_type == IS_CV) {
if (opline->opcode == ZEND_COPY_TMP || opline->op1_type == IS_CV) {
tmp |= MAY_BE_RCN;
}
}

View File

@ -766,6 +766,14 @@ add_op1_def:
//NEW_SSA_VAR(opline->op2.var)
}
break;
case ZEND_COPY_TMP:
if (build_flags & ZEND_SSA_RC_INFERENCE) {
ssa_ops[k].op1_def = ssa_vars_count;
var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count;
ssa_vars_count++;
//NEW_SSA_VAR(opline->op1.var)
}
break;
default:
break;
}

View File

@ -0,0 +1,15 @@
--TEST--
JIT COPY_TMP: 002
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.protect_memory=1
--FILE--
<?php
$x[~"abc"] ??= 0;
?>
DONE
--EXPECT--
DONE