mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Allow FETCH_OBJ_W and FETCH_STATIC_PROP_W to return INDIRECT/UNDEF zval for uninitialized typed properties (#11048)
This commit is contained in:
commit
e14ac1caee
7 changed files with 63 additions and 38 deletions
|
@ -3472,6 +3472,9 @@ static zend_always_inline zend_result _zend_update_type_info(
|
|||
tmp |= zend_fetch_prop_type(script, prop_info, &ce);
|
||||
if (opline->opcode != ZEND_FETCH_OBJ_R && opline->opcode != ZEND_FETCH_OBJ_IS) {
|
||||
tmp |= MAY_BE_REF | MAY_BE_INDIRECT;
|
||||
if ((opline->extended_value & ZEND_FETCH_OBJ_FLAGS) == ZEND_FETCH_DIM_WRITE) {
|
||||
tmp |= MAY_BE_UNDEF;
|
||||
}
|
||||
ce = NULL;
|
||||
} else if (!(opline->op1_type & (IS_VAR|IS_TMP_VAR)) || !(t1 & MAY_BE_RC1)) {
|
||||
zend_class_entry *ce = NULL;
|
||||
|
@ -3511,6 +3514,9 @@ static zend_always_inline zend_result _zend_update_type_info(
|
|||
if (opline->opcode != ZEND_FETCH_STATIC_PROP_R
|
||||
&& opline->opcode != ZEND_FETCH_STATIC_PROP_IS) {
|
||||
tmp |= MAY_BE_REF | MAY_BE_INDIRECT;
|
||||
if ((opline->extended_value & ZEND_FETCH_OBJ_FLAGS) == ZEND_FETCH_DIM_WRITE) {
|
||||
tmp |= MAY_BE_UNDEF;
|
||||
}
|
||||
ce = NULL;
|
||||
} else {
|
||||
if (!result_may_be_separated(ssa, ssa_op)) {
|
||||
|
|
|
@ -3050,7 +3050,7 @@ static zend_never_inline bool zend_handle_fetch_obj_flags(
|
|||
return 1;
|
||||
}
|
||||
|
||||
static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags, bool init_undef OPLINE_DC EXECUTE_DATA_DC)
|
||||
static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type, uint32_t flags OPLINE_DC EXECUTE_DATA_DC)
|
||||
{
|
||||
zval *ptr;
|
||||
zend_object *zobj;
|
||||
|
@ -3168,9 +3168,6 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
|
|||
}
|
||||
}
|
||||
}
|
||||
if (init_undef && UNEXPECTED(Z_TYPE_P(ptr) == IS_UNDEF)) {
|
||||
ZVAL_NULL(ptr);
|
||||
}
|
||||
|
||||
end:
|
||||
if (prop_op_type != IS_CONST) {
|
||||
|
@ -3184,7 +3181,7 @@ static zend_always_inline void zend_assign_to_property_reference(zval *container
|
|||
void **cache_addr = (prop_op_type == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_RETURNS_FUNCTION) : NULL;
|
||||
|
||||
zend_fetch_property_address(variable_ptr, container, container_op_type, prop_ptr, prop_op_type,
|
||||
cache_addr, BP_VAR_W, 0, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
cache_addr, BP_VAR_W, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (EXPECTED(Z_TYPE_P(variable_ptr) == IS_INDIRECT)) {
|
||||
variable_ptr = Z_INDIRECT_P(variable_ptr);
|
||||
|
|
|
@ -1064,6 +1064,8 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *nam
|
|||
} else if (prop_info && UNEXPECTED(prop_info->flags & ZEND_ACC_READONLY)) {
|
||||
/* Readonly property, delegate to read_property + write_property. */
|
||||
retval = NULL;
|
||||
} else if (!prop_info || !ZEND_TYPE_IS_SET(prop_info->type)) {
|
||||
ZVAL_NULL(retval);
|
||||
}
|
||||
} else {
|
||||
/* we do have getter - fail and let it try again with usual get/set */
|
||||
|
|
|
@ -2166,7 +2166,7 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH
|
|||
zend_fetch_property_address(
|
||||
result, container, OP1_TYPE, property, OP2_TYPE,
|
||||
((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
FREE_OP2();
|
||||
if (OP1_TYPE == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -2183,7 +2183,7 @@ ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACH
|
|||
container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_RW);
|
||||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
FREE_OP2();
|
||||
if (OP1_TYPE == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -2329,7 +2329,7 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, C
|
|||
container = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_UNSET);
|
||||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, OP1_TYPE, property, OP2_TYPE, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
FREE_OP2();
|
||||
if (OP1_TYPE == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
|
54
Zend/zend_vm_execute.h
generated
54
Zend/zend_vm_execute.h
generated
|
@ -22957,7 +22957,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_VAR, property, IS_CONST,
|
||||
((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -22974,7 +22974,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HA
|
|||
container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||
property = RT_CONSTANT(opline, opline->op2);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -23008,7 +23008,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST
|
|||
container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||
property = RT_CONSTANT(opline, opline->op2);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -25669,7 +25669,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMPVAR_HA
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR),
|
||||
(((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -25686,7 +25686,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMPVAR_H
|
|||
container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||
property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -25720,7 +25720,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVA
|
|||
container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||
property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -29877,7 +29877,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLE
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_VAR, property, IS_CV,
|
||||
((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -29894,7 +29894,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDL
|
|||
container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -29928,7 +29928,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HA
|
|||
container = _get_zval_ptr_ptr_var(opline->op1.var EXECUTE_DATA_CC);
|
||||
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_VAR, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_VAR == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -32369,7 +32369,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_UNUSED, property, IS_CONST,
|
||||
((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -32386,7 +32386,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST
|
|||
container = &EX(This);
|
||||
property = RT_CONSTANT(opline, opline->op2);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -32532,7 +32532,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO
|
|||
container = &EX(This);
|
||||
property = RT_CONSTANT(opline, opline->op2);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -34244,7 +34244,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMPVAR
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR),
|
||||
(((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -34261,7 +34261,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMPVA
|
|||
container = &EX(This);
|
||||
property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -34407,7 +34407,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TM
|
|||
container = &EX(This);
|
||||
property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -36722,7 +36722,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HAN
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_UNUSED, property, IS_CV,
|
||||
((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -36739,7 +36739,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HA
|
|||
container = &EX(This);
|
||||
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -36885,7 +36885,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV
|
|||
container = &EX(This);
|
||||
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_UNUSED, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_UNUSED == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -40900,7 +40900,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_CV, property, IS_CONST,
|
||||
((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -40917,7 +40917,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HAN
|
|||
container = EX_VAR(opline->op1.var);
|
||||
property = RT_CONSTANT(opline, opline->op2);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -41063,7 +41063,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_
|
|||
container = EX_VAR(opline->op1.var);
|
||||
property = RT_CONSTANT(opline, opline->op2);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -44685,7 +44685,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMPVAR_HAN
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR),
|
||||
(((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -44702,7 +44702,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMPVAR_HA
|
|||
container = EX_VAR(opline->op1.var);
|
||||
property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -44848,7 +44848,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR
|
|||
container = EX_VAR(opline->op1.var);
|
||||
property = _get_zval_ptr_var(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, (IS_TMP_VAR|IS_VAR), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -50009,7 +50009,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER
|
|||
zend_fetch_property_address(
|
||||
result, container, IS_CV, property, IS_CV,
|
||||
((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_FETCH_OBJ_FLAGS) : NULL),
|
||||
BP_VAR_W, opline->extended_value, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
BP_VAR_W, opline->extended_value OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -50026,7 +50026,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLE
|
|||
container = EX_VAR(opline->op1.var);
|
||||
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_RW, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
@ -50172,7 +50172,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HAN
|
|||
container = EX_VAR(opline->op1.var);
|
||||
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
|
||||
result = EX_VAR(opline->result.var);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0, 1 OPLINE_CC EXECUTE_DATA_CC);
|
||||
zend_fetch_property_address(result, container, IS_CV, property, IS_CV, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL), BP_VAR_UNSET, 0 OPLINE_CC EXECUTE_DATA_CC);
|
||||
|
||||
if (IS_CV == IS_VAR) {
|
||||
FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(opline->op1.var);
|
||||
|
|
|
@ -7365,7 +7365,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa
|
|||
fprintf(stderr, " op1(%sobject of class %s)", ref,
|
||||
ZSTR_VAL(p->ce->name));
|
||||
} else {
|
||||
const char *type = (op1_type == 0) ? "undef" : zend_get_type_by_const(op1_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT|IS_TRACE_PACKED));
|
||||
const char *type = ((op1_type & ~IS_TRACE_INDIRECT) == 0) ? "undef" : zend_get_type_by_const(op1_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT|IS_TRACE_PACKED));
|
||||
fprintf(stderr, " op1(%s%s%s)", ref, (op1_type & IS_TRACE_PACKED) ? "packed " : "", type);
|
||||
}
|
||||
}
|
||||
|
@ -7378,7 +7378,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa
|
|||
fprintf(stderr, " op2(%sobject of class %s)", ref,
|
||||
ZSTR_VAL(p->ce->name));
|
||||
} else {
|
||||
const char *type = (op2_type == 0) ? "undef" : zend_get_type_by_const(op2_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT));
|
||||
const char *type = ((op2_type & ~IS_TRACE_INDIRECT) == 0) ? "undef" : zend_get_type_by_const(op2_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT));
|
||||
fprintf(stderr, " op2(%s%s)", ref, type);
|
||||
}
|
||||
}
|
||||
|
@ -7386,7 +7386,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa
|
|||
const char *ref = (op3_type & IS_TRACE_INDIRECT) ?
|
||||
((op3_type & IS_TRACE_REFERENCE) ? "*&" : "*") :
|
||||
((op3_type & IS_TRACE_REFERENCE) ? "&" : "");
|
||||
const char *type = (op3_type == 0) ? "undef" : zend_get_type_by_const(op3_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT));
|
||||
const char *type = ((op3_type & ~IS_TRACE_INDIRECT) == 0) ? "undef" : zend_get_type_by_const(op3_type & ~(IS_TRACE_REFERENCE|IS_TRACE_INDIRECT));
|
||||
fprintf(stderr, " op3(%s%s)", ref, type);
|
||||
}
|
||||
}
|
||||
|
|
20
ext/opcache/tests/jit/fetch_static_prop_001.phpt
Normal file
20
ext/opcache/tests/jit/fetch_static_prop_001.phpt
Normal file
|
@ -0,0 +1,20 @@
|
|||
--TEST--
|
||||
FETCH_STATIC_PROP_W should not return UNDEF
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
--FILE--
|
||||
<?php
|
||||
class F {
|
||||
static array $a;
|
||||
}
|
||||
F::$a[] = 2;
|
||||
var_dump(F::$a);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(2)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue