mirror of
https://github.com/php/php-src.git
synced 2025-01-09 12:34:14 +08:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fixed incorrect reference counter inference
This commit is contained in:
commit
9bd490dc33
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
15
ext/opcache/tests/jit/copy_tmp_002.phpt
Normal file
15
ext/opcache/tests/jit/copy_tmp_002.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user