mirror of
https://github.com/php/php-src.git
synced 2025-01-09 12:34:14 +08:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fixed type inference for COPY_TMP
This commit is contained in:
commit
176c319109
@ -2584,7 +2584,7 @@ static zend_always_inline zend_result _zend_update_type_info(
|
||||
tmp |= MAY_BE_RCN;
|
||||
}
|
||||
}
|
||||
if (opline->opcode != ZEND_QM_ASSIGN) {
|
||||
if (opline->opcode == ZEND_COALESCE || opline->opcode == ZEND_JMP_SET) {
|
||||
/* COALESCE and JMP_SET result can't be null */
|
||||
tmp &= ~MAY_BE_NULL;
|
||||
if (opline->opcode == ZEND_JMP_SET) {
|
||||
|
23
ext/opcache/tests/jit/copy_tmp_001.phpt
Normal file
23
ext/opcache/tests/jit/copy_tmp_001.phpt
Normal file
@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
JIT COPY_TMP: 001
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
echo "";
|
||||
}
|
||||
|
||||
$a = [];
|
||||
$a[test()] ??= 1;
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[""]=>
|
||||
int(1)
|
||||
}
|
Loading…
Reference in New Issue
Block a user