1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix inference of COPY_TMP

Since GH-11592 COPY_TMP may receive and thus define references. Unfortunately,
the name COPY_TMP is no longer accurate.

Closes GH-12619
This commit is contained in:
Ilija Tovilo
2023-11-06 12:18:59 +01:00
parent 85cb081661
commit cb1e842929
4 changed files with 8 additions and 1 deletions

1
NEWS
View File

@@ -42,6 +42,7 @@ PHP NEWS
. Added warning when JIT cannot be enabled. (danog)
. Fixed bug GH-8143 (Crashes in zend_accel_inheritance_cache_find since
upgrading to 8.1.3 due to corrupt on-disk file cache). (turchanov)
. Fixed COPY_TMP type inference for references. (ilutov)
- OpenSSL:
. Fixed bug GH-12489 (Missing sigbio creation checking in openssl_cms_verify).

View File

@@ -2697,7 +2697,10 @@ static zend_always_inline zend_result _zend_update_type_info(
UPDATE_SSA_TYPE(tmp, ssa_op->op1_def);
COPY_SSA_OBJ_TYPE(ssa_op->op1_use, ssa_op->op1_def);
}
tmp = t1 & ~(MAY_BE_UNDEF|MAY_BE_REF);
tmp = t1 & ~MAY_BE_UNDEF;
if (opline->opcode != ZEND_COPY_TMP || opline->op1_type != IS_VAR) {
tmp &= ~MAY_BE_REF;
}
if (t1 & MAY_BE_UNDEF) {
tmp |= MAY_BE_NULL;
}

View File

@@ -9516,6 +9516,7 @@ ZEND_VM_HANDLER(172, ZEND_FUNC_GET_ARGS, UNUSED|CONST, UNUSED)
ZEND_VM_NEXT_OPCODE();
}
/* Contrary to what its name indicates, ZEND_COPY_TMP may receive and define references. */
ZEND_VM_HANDLER(167, ZEND_COPY_TMP, TMPVAR, UNUSED)
{
USE_OPLINE

View File

@@ -11085,6 +11085,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSE
ZEND_VM_NEXT_OPCODE();
}
/* Contrary to what its name indicates, ZEND_COPY_TMP may receive and define references. */
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
@@ -37183,6 +37184,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUS
ZEND_VM_NEXT_OPCODE();
}
/* Contrary to what its name indicates, ZEND_COPY_TMP may receive and define references. */
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALLABLE_CONVERT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE