From: Nikita Popov Date: Wed, 5 Jun 2019 12:38:01 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7686b0b88906e2522300b9e631ddde2051de839f;p=php Merge branch 'PHP-7.4' --- 7686b0b88906e2522300b9e631ddde2051de839f diff --cc Zend/zend_API.c index 8d4d8b25a3,f88fc2caf8..b638f5c46c --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@@ -693,9 -821,13 +701,12 @@@ static int zend_parse_arg(int arg_num, { const char *expected_type = NULL; char *error = NULL; - int severity = 0; - expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error, &severity); + expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, &error); if (expected_type) { + if (EG(exception)) { + return FAILURE; + } if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) { const char *space; const char *class_name = get_active_class_name(&space); diff --cc Zend/zend_API.h index 78640b7714,4732173654..d88fa5a856 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@@ -1168,13 -1180,25 +1167,13 @@@ ZEND_API ZEND_COLD void ZEND_FASTCALL z #define ZEND_PARSE_PARAMETERS_END_EX(failure) \ } while (0); \ if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \ - if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \ + if (!(_flags & ZEND_PARSE_PARAMS_QUIET) && !EG(exception)) { \ if (_error_code == ZPP_ERROR_WRONG_CALLBACK) { \ - if (_flags & ZEND_PARSE_PARAMS_THROW) { \ - zend_wrong_callback_exception(_i, _error); \ - } else { \ - zend_wrong_callback_error(_i, _error); \ - } \ + zend_wrong_callback_error(_i, _error); \ } else if (_error_code == ZPP_ERROR_WRONG_CLASS) { \ - if (_flags & ZEND_PARSE_PARAMS_THROW) { \ - zend_wrong_parameter_class_exception(_i, _error, _arg); \ - } else { \ - zend_wrong_parameter_class_error(_i, _error, _arg); \ - } \ + zend_wrong_parameter_class_error(_i, _error, _arg); \ } else if (_error_code == ZPP_ERROR_WRONG_ARG) { \ - if (_flags & ZEND_PARSE_PARAMS_THROW) { \ - zend_wrong_parameter_type_exception(_i, _expected_type, _arg); \ - } else { \ - zend_wrong_parameter_type_error(_i, _expected_type, _arg); \ - } \ + zend_wrong_parameter_type_error(_i, _expected_type, _arg); \ } \ } \ failure; \ diff --cc Zend/zend_object_handlers.c index 88b8aa16a0,10f5ac1524..0e8375c1fe --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@@ -1707,24 -1759,9 +1707,9 @@@ ZEND_API int zend_std_cast_object_tostr switch (type) { case IS_STRING: - ce = Z_OBJCE_P(readobj); + ce = readobj->ce; - if (ce->__tostring && - (zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) { - if (UNEXPECTED(EG(exception) != NULL)) { - zval *msg, ex, rv; - zval_ptr_dtor(&retval); - ZVAL_OBJ(&ex, EG(exception)); - EG(exception) = NULL; - msg = zend_read_property(Z_OBJCE(ex), &ex, "message", sizeof("message") - 1, 1, &rv); - if (UNEXPECTED(Z_TYPE_P(msg) != IS_STRING)) { - ZVAL_EMPTY_STRING(&rv); - msg = &rv; - } - zend_error_noreturn(E_ERROR, - "Method %s::__toString() must not throw an exception, caught %s: %s", - ZSTR_VAL(ce->name), ZSTR_VAL(Z_OBJCE(ex)->name), Z_STRVAL_P(msg)); - return FAILURE; - } + if (ce->__tostring) { + zend_call_method_with_0_params(readobj, ce, &ce->__tostring, "__tostring", &retval); if (EXPECTED(Z_TYPE(retval) == IS_STRING)) { ZVAL_COPY_VALUE(writeobj, &retval); return SUCCESS; diff --cc Zend/zend_operators.c index 9cf0dcd22f,896f6dcbe1..54aa7356cd --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@@ -561,19 -568,33 +561,23 @@@ try_again case IS_ARRAY: zend_error(E_NOTICE, "Array to string conversion"); zval_ptr_dtor(op); - ZVAL_NEW_STR(op, zend_string_init("Array", sizeof("Array")-1, 0)); + ZVAL_INTERNED_STR(op, ZSTR_KNOWN(ZEND_STR_ARRAY_CAPITALIZED)); break; case IS_OBJECT: { - zval dst; - - convert_object_to_type(op, &dst, IS_STRING, convert_to_string); - zval_ptr_dtor(op); + zval tmp; - if (Z_TYPE(dst) == IS_STRING) { - ZVAL_COPY_VALUE(op, &dst); - } else { - ZVAL_NEW_STR(op, zend_string_init("Object", sizeof("Object")-1, 0)); + if (Z_OBJ_HT_P(op)->cast_object) { - if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_STRING) == SUCCESS) { ++ if (Z_OBJ_HT_P(op)->cast_object(Z_OBJ_P(op), &tmp, IS_STRING) == SUCCESS) { + zval_ptr_dtor(op); + ZVAL_COPY_VALUE(op, &tmp); + return; + } - } else if (Z_OBJ_HT_P(op)->get) { - zval *z = Z_OBJ_HT_P(op)->get(op, &tmp); - if (Z_TYPE_P(z) != IS_OBJECT) { - zend_string *str = zval_get_string(z); - zval_ptr_dtor(z); - zval_ptr_dtor(op); - ZVAL_STR(op, str); - return; - } - zval_ptr_dtor(z); } + if (!EG(exception)) { + zend_throw_error(NULL, "Object of class %s could not be converted to string", ZSTR_VAL(Z_OBJCE_P(op)->name)); + } + zval_ptr_dtor(op); + ZVAL_EMPTY_STRING(op); break; } case IS_REFERENCE: @@@ -856,11 -890,21 +873,13 @@@ try_again case IS_OBJECT: { zval tmp; if (Z_OBJ_HT_P(op)->cast_object) { - if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_STRING) == SUCCESS) { + if (Z_OBJ_HT_P(op)->cast_object(Z_OBJ_P(op), &tmp, IS_STRING) == SUCCESS) { return Z_STR(tmp); } - } else if (Z_OBJ_HT_P(op)->get) { - zval *z = Z_OBJ_HT_P(op)->get(op, &tmp); - if (Z_TYPE_P(z) != IS_OBJECT) { - zend_string *str = zval_get_string(z); - zval_ptr_dtor(z); - return str; - } - zval_ptr_dtor(z); } - zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Object of class %s could not be converted to string", ZSTR_VAL(Z_OBJCE_P(op)->name)); + if (!EG(exception)) { + zend_throw_error(NULL, "Object of class %s could not be converted to string", ZSTR_VAL(Z_OBJCE_P(op)->name)); + } return ZSTR_EMPTY_ALLOC(); } case IS_REFERENCE: diff --cc Zend/zend_vm_def.h index 45be4fc09c,f31b05991d..bd0c44dfdf --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@@ -887,14 -885,8 +887,18 @@@ ZEND_VM_HELPER(zend_binary_assign_op_ob ZEND_VM_C_LABEL(assign_op_object): /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (OP2_TYPE == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -1261,14 -1248,8 +1265,18 @@@ ZEND_VM_HELPER(zend_pre_incdec_property ZEND_VM_C_LABEL(pre_incdec_object): /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -1339,14 -1315,8 +1347,18 @@@ ZEND_VM_HELPER(zend_post_incdec_propert ZEND_VM_C_LABEL(post_incdec_object): /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -2062,18 -2032,11 +2079,22 @@@ ZEND_VM_HOT_OBJ_HANDLER(82, ZEND_FETCH_ } } } - } else if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { ZEND_VM_C_LABEL(fetch_obj_r_copy): @@@ -2213,15 -2174,9 +2234,19 @@@ ZEND_VM_COLD_CONST_HANDLER(91, ZEND_FET } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { ZEND_VM_C_LABEL(fetch_obj_is_copy): @@@ -2431,17 -2383,7 +2456,22 @@@ ZEND_VM_C_LABEL(fast_assign_obj) ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ FREE_OP_DATA(); ++ UNDEF_RESULT(); ++ ZEND_VM_C_GOTO(exit_assign_obj); ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -5995,6 -5973,6 +6029,10 @@@ ZEND_VM_COLD_HANDLER(179, ZEND_UNSET_ST varname = ZVAL_UNDEFINED_OP1(); } name = zval_get_tmp_string(varname, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ FREE_OP1(); ++ HANDLE_EXCEPTION(); ++ } } zend_std_unset_static_property(ce, name); @@@ -6121,15 -6098,7 +6159,18 @@@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); FREE_OP2(); @@@ -6842,19 -6803,9 +6883,23 @@@ ZEND_VM_COLD_CONST_HANDLER(148, ZEND_IS } } + if (OP2_TYPE == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ ZEND_VM_C_GOTO(isset_object_finish); ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (OP2_TYPE != IS_CONST) { + zend_tmp_string_release(tmp_name); + } ZEND_VM_C_LABEL(isset_object_finish): FREE_OP2(); @@@ -7983,8 -7932,10 +8028,10 @@@ ZEND_VM_COLD_CONST_HANDLER(121, ZEND_ST } zval_ptr_dtor(&tmp); } - zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + if (!EG(exception)) { - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); ++ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + } - ZVAL_NULL(EX_VAR(opline->result.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } FREE_OP1(); diff --cc Zend/zend_vm_execute.h index 72c7fe4529,178f7b335a..c86dff733e --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@@ -1947,6 -1978,6 +1947,10 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER varname = ZVAL_UNDEFINED_OP1(); } name = zval_get_tmp_string(varname, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ FREE_OP(free_op1); ++ HANDLE_EXCEPTION(); ++ } } zend_std_unset_static_property(ce, name); @@@ -4163,8 -4184,10 +4167,10 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } zval_ptr_dtor(&tmp); } - zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + if (!EG(exception)) { - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); ++ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + } - ZVAL_NULL(EX_VAR(opline->result.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } @@@ -5206,18 -5227,11 +5212,22 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } } - } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -5309,15 -5321,9 +5319,19 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -6107,19 -6130,9 +6121,23 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: @@@ -7414,18 -7425,11 +7432,22 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } } - } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -7517,15 -7519,9 +7539,19 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -8245,19 -8258,9 +8271,23 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: zval_ptr_dtor_nogc(free_op2); @@@ -10156,18 -10169,11 +10195,22 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } } - } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -10259,15 -10263,9 +10302,19 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -10986,19 -11001,9 +11033,23 @@@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER } } + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: @@@ -12967,8 -12970,10 +13018,10 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } zval_ptr_dtor(&tmp); } - zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + if (!EG(exception)) { - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); ++ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + } - ZVAL_NULL(EX_VAR(opline->result.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } zval_ptr_dtor_nogc(free_op1); @@@ -13850,18 -13853,11 +13903,22 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } - } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -13953,15 -13947,9 +14010,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -14415,19 -14403,9 +14476,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: @@@ -15461,18 -15437,11 +15526,22 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } - } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -15564,15 -15531,9 +15633,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -16026,19 -15987,9 +16099,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: zval_ptr_dtor_nogc(free_op2); @@@ -16155,6 -16106,10 +16232,11 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS ZVAL_UNDEFINED_OP1(); } name = zval_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(EG(exception))) { + zval_ptr_dtor_nogc(free_op1); ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } } target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); @@@ -16275,6 -16230,11 +16357,10 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS varname = ZVAL_UNDEFINED_OP1(); } name = zval_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(EG(exception))) { + zval_ptr_dtor_nogc(free_op1); - ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } } target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); @@@ -16939,18 -16897,11 +17025,22 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } - } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -17042,15 -16991,9 +17132,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -17504,19 -17447,9 +17598,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: @@@ -22106,14 -22020,8 +22204,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -22712,14 -22615,8 +22814,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -22789,14 -22681,8 +22895,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -23127,17 -23007,7 +23237,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -23274,17 -23141,7 +23389,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -23421,17 -23275,7 +23541,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -23568,17 -23409,7 +23693,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -24715,15 -24550,7 +24845,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@@ -24946,14 -24771,8 +25079,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -25554,14 -25368,8 +25691,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -25632,14 -25435,8 +25773,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -25972,17 -25763,7 +26117,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -26119,17 -25897,7 +26269,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -26266,17 -26031,7 +26421,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -26413,17 -26165,7 +26573,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -27434,15 -27180,7 +27599,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); zval_ptr_dtor_nogc(free_op2); @@@ -29445,14 -29184,8 +29613,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -29957,14 -29685,8 +30129,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -30034,14 -29751,8 +30210,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -30372,17 -30077,7 +30552,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -30519,17 -30211,7 +30704,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -30666,17 -30345,7 +30856,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -30813,17 -30479,7 +31008,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -31928,15 -31588,7 +32128,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@@ -32374,14 -32022,8 +32577,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -32562,14 -32199,8 +32769,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -32639,14 -32265,8 +32850,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -32764,18 -32379,11 +32979,22 @@@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_ } } } - } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -32915,15 -32521,9 +33134,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -33096,17 -32693,7 +33319,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -33243,17 -32827,7 +33471,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -33390,17 -32961,7 +33623,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -33537,17 -33095,7 +33775,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -34215,15 -33768,7 +34458,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); @@@ -34262,19 -33806,9 +34508,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: @@@ -34459,14 -33991,8 +34709,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -34647,14 -34168,8 +34901,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -34725,14 -34235,8 +34983,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -34851,18 -34350,11 +35113,22 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } - } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -35002,15 -34492,9 +35268,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -35183,17 -34664,7 +35453,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -35330,17 -34798,7 +35605,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -35477,17 -34932,7 +35757,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -35624,17 -35066,7 +35909,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -36216,15 -35653,7 +36506,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); zval_ptr_dtor_nogc(free_op2); @@@ -36264,19 -35692,9 +36557,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: zval_ptr_dtor_nogc(free_op2); @@@ -37213,14 -36634,8 +37510,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -37401,14 -36811,8 +37702,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -37478,14 -36877,8 +37783,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -37603,18 -36991,11 +37912,22 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } - } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -37754,15 -37133,9 +38067,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -37935,17 -37305,7 +38252,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -38082,17 -37439,7 +38404,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -38229,17 -37573,7 +38556,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -38376,17 -37707,7 +38708,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -38967,15 -38293,7 +39304,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); @@@ -39014,19 -38331,9 +39354,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: @@@ -40765,8 -40063,10 +41109,10 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } zval_ptr_dtor(&tmp); } - zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + if (!EG(exception)) { - zend_internal_type_error(strict, "strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); ++ zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + } - ZVAL_NULL(EX_VAR(opline->result.var)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); } @@@ -41630,14 -40928,8 +41976,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -42236,14 -41523,8 +42586,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -42313,14 -41589,8 +42667,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -42554,18 -41819,11 +42912,22 @@@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_ } } } - } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -42705,15 -41961,9 +43067,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -42886,17 -42133,7 +43252,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -43033,17 -42267,7 +43404,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -43180,17 -42401,7 +43556,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -43327,17 -42535,7 +43708,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -44521,15 -43719,7 +44907,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); @@@ -44648,19 -43837,9 +45037,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if (IS_CONST == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CONST != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: @@@ -45859,14 -45036,8 +46252,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -46467,14 -45633,8 +46864,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -46545,14 -45700,8 +46946,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -46787,18 -45931,11 +47192,22 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } - } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -46938,15 -46073,9 +47347,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -47119,17 -46245,7 +47532,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -47266,17 -46379,7 +47684,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -47413,17 -46513,7 +47836,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -47560,17 -46647,7 +47988,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -48699,15 -47776,7 +49132,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); zval_ptr_dtor_nogc(free_op2); @@@ -48827,19 -47895,9 +49263,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: zval_ptr_dtor_nogc(free_op2); @@@ -49741,6 -48799,10 +50181,11 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS ZVAL_UNDEFINED_OP1(); } name = zval_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(EG(exception))) { + ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } } target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); @@@ -50563,6 -49625,11 +51008,10 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS varname = ZVAL_UNDEFINED_OP1(); } name = zval_get_tmp_string(varname, &tmp_name); + if (UNEXPECTED(EG(exception))) { + - ZVAL_UNDEF(EX_VAR(opline->result.var)); + HANDLE_EXCEPTION(); + } } target_symbol_table = zend_get_target_symbol_table(opline->extended_value EXECUTE_DATA_CC); @@@ -51846,14 -50909,8 +52295,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS assign_op_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -52358,14 -51410,8 +52811,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS pre_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ UNDEF_RESULT(); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@@ -52435,14 -51476,8 +52892,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS post_incdec_object: /* here we are sure we are dealing with an object */ + zobj = Z_OBJ_P(object); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } + } cache_slot = (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL; - if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, cache_slot)) != NULL)) { + if (EXPECTED((zptr = zobj->handlers->get_property_ptr_ptr(zobj, name, BP_VAR_RW, cache_slot)) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@@ -52676,18 -51706,11 +53137,22 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } - } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { - ZVAL_UNDEFINED_OP2(); + } else { + if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) { + ZVAL_UNDEFINED_OP2(); + } + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_r_copy: @@@ -52827,15 -51848,9 +53292,19 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } } + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ZVAL_UNDEF(EX_VAR(opline->result.var)); ++ break; ++ } } - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(zobj, name, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (retval != EX_VAR(opline->result.var)) { fetch_obj_is_copy: @@@ -53008,17 -52020,7 +53477,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -53155,17 -52154,7 +53629,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -53302,17 -52288,7 +53781,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ zval_ptr_dtor_nogc(free_op_data); ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -53449,17 -52422,7 +53933,22 @@@ fast_assign_obj ZVAL_DEREF(value); } - property = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + if (IS_CV == IS_CONST) { + name = Z_STR_P(property); + } else { + name = zval_get_tmp_string(property, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ ++ UNDEF_RESULT(); ++ goto exit_assign_obj; ++ } + } + + property = zobj->handlers->write_property(zobj, name, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_COPY(EX_VAR(opline->result.var), property); @@@ -54682,15 -53645,7 +55171,18 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS break; } } - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ break; ++ } + } + Z_OBJ_HT_P(container)->unset_property(Z_OBJ_P(container), name, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } } while (0); @@@ -54809,19 -53763,9 +55301,23 @@@ static ZEND_OPCODE_HANDLER_RET ZEND_FAS } } + if (IS_CV == IS_CONST) { + name = Z_STR_P(offset); + } else { + name = zval_get_tmp_string(offset, &tmp_name); ++ if (UNEXPECTED(EG(exception))) { ++ result = 0; ++ goto isset_object_finish; ++ } + } + result = (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + Z_OBJ_HT_P(container)->has_property(Z_OBJ_P(container), name, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + + if (IS_CV != IS_CONST) { + zend_tmp_string_release(tmp_name); + } isset_object_finish: diff --cc ext/openssl/tests/bug38261.phpt index 41a881cc86,e6e345d5ea..b6b3f4c609 --- a/ext/openssl/tests/bug38261.phpt +++ b/ext/openssl/tests/bug38261.phpt @@@ -17,14 -17,21 +17,17 @@@ $t = new test var_dump(openssl_x509_parse("foo")); var_dump(openssl_x509_parse($t)); var_dump(openssl_x509_parse(array())); -var_dump(openssl_x509_parse()); var_dump(openssl_x509_parse($cert)); - var_dump(openssl_x509_parse(new stdClass)); + try { + var_dump(openssl_x509_parse(new stdClass)); + } catch (Error $e) { + echo $e->getMessage(), "\n"; + } ?> --EXPECTF-- bool(false) bool(false) bool(false) - -Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %sbug38261.php on line %d -NULL bool(false) - - Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug38261.php on line %d + Object of class stdClass could not be converted to string diff --cc ext/reflection/php_reflection.c index de36446a7c,4623efb3cf..8e375ccc80 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@@ -2402,6 -2402,18 +2402,16 @@@ ZEND_METHOD(reflection_parameter, __con } else { ZVAL_NULL(prop_name); } + return; + + failure: + if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) { - if (fptr->type != ZEND_OVERLOADED_FUNCTION) { - zend_string_release_ex(fptr->common.function_name, 0); - } ++ zend_string_release_ex(fptr->common.function_name, 0); + zend_free_trampoline(fptr); + } + if (is_closure) { + zval_ptr_dtor(reference); + } } /* }}} */ diff --cc ext/reflection/tests/bug74673.phpt index 07db9a169a,47f7604e8b..42675f263e --- a/ext/reflection/tests/bug74673.phpt +++ b/ext/reflection/tests/bug74673.phpt @@@ -15,4 -19,9 +15,8 @@@ $class = new ReflectionClass('A') echo $class; ?> --EXPECTF-- - Fatal error: Method ReflectionClass::__toString() must not throw an exception, caught Error: Undefined constant 'PHP_SELF' in %s on line %d -Fatal error: Uncaught Exception in %s:%d ++Fatal error: Uncaught Error: Undefined constant 'PHP_SELF' in %s:%d + Stack trace: -#0 [internal function]: {closure}(2, 'Use of undefine...', %s, %d, Array) -#1 %s(%d): ReflectionClass->__toString() -#2 {main} ++#0 %s(%d): ReflectionClass->__toString() ++#1 {main} + thrown in %s on line %d diff --cc ext/simplexml/simplexml.c index cd00854001,01c119888e..c21b6dad24 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@@ -679,12 -678,14 +686,11 @@@ static zval *sxe_property_get_adr(zend_ zval ret; char *name; SXE_ITER type; + zval member; - if (!try_convert_to_string(member)) { - return NULL; - } - - sxe = Z_SXEOBJ_P(object); + sxe = php_sxe_fetch_object(object); - GET_NODE(sxe, node); - name = Z_STRVAL_P(member); + name = ZSTR_VAL(zname); node = sxe_get_element_by_name(sxe, node, &name, &type); if (node) { return NULL; @@@ -722,9 -722,12 +728,12 @@@ static int sxe_prop_dim_exists(zend_obj if (Z_TYPE_P(member) != IS_STRING && Z_TYPE_P(member) != IS_LONG) { ZVAL_STR(&tmp_zv, zval_get_string_func(member)); member = &tmp_zv; + if (EG(exception)) { + return 0; + } } - sxe = Z_SXEOBJ_P(object); + sxe = php_sxe_fetch_object(object); GET_NODE(sxe, node); @@@ -843,9 -844,12 +852,12 @@@ static void sxe_prop_dim_delete(zend_ob if (Z_TYPE_P(member) != IS_STRING && Z_TYPE_P(member) != IS_LONG) { ZVAL_STR(&tmp_zv, zval_get_string_func(member)); member = &tmp_zv; + if (EG(exception)) { + return; + } } - sxe = Z_SXEOBJ_P(object); + sxe = php_sxe_fetch_object(object); GET_NODE(sxe, node); diff --cc ext/snmp/snmp.c index 135ff83b9d,69ff9b00f4..1f985316c1 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@@ -1914,9 -1915,17 +1914,8 @@@ zval *php_snmp_read_property(zend_objec php_snmp_prop_handler *hnd; int ret; - obj = Z_SNMP_P(object); - - if (Z_TYPE_P(member) != IS_STRING) { - ZVAL_STR(&tmp_member, zval_get_string_func(member)); - member = &tmp_member; - if (EG(exception)) { - return &EG(uninitialized_zval); - } - } - - hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member)); + obj = php_snmp_fetch_object(object); - + hnd = zend_hash_find_ptr(&php_snmp_properties, name); if (hnd && hnd->read_func) { ret = hnd->read_func(obj, rv); @@@ -1940,9 -1953,18 +1939,8 @@@ zval *php_snmp_write_property(zend_obje php_snmp_object *obj; php_snmp_prop_handler *hnd; - if (Z_TYPE_P(member) != IS_STRING) { - ZVAL_STR(&tmp_member, zval_get_string_func(member)); - member = &tmp_member; - if (EG(exception)) { - return value; - } - } - - obj = Z_SNMP_P(object); - - hnd = zend_hash_find_ptr(&php_snmp_properties, Z_STR_P(member)); + obj = php_snmp_fetch_object(object); - + hnd = zend_hash_find_ptr(&php_snmp_properties, name); if (hnd && hnd->write_func) { hnd->write_func(obj, value); diff --cc ext/standard/tests/math/base_convert_error.phpt index 7e1a12c8bc,96e774b51f..5bd64a536b --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@@ -14,10 -14,19 +14,15 @@@ class class { } -echo "Incorrect number of arguments\n"; -base_convert(); -base_convert(35); -base_convert(35,2); +echo "Incorrect input\n"; base_convert(1234, 1, 10); base_convert(1234, 10, 37); - base_convert(new classA(), 8, 10); + -echo "Incorrect input\n"; + try { + base_convert(new classA(), 8, 10); + } catch (Error $e) { + echo $e->getMessage(), "\n"; + } ?> --EXPECTF-- @@@ -27,5 -42,5 +32,4 @@@ Incorrect inpu Warning: base_convert(): Invalid `from base' (1) in %s on line %d Warning: base_convert(): Invalid `to base' (37) in %s on line %d - - Recoverable fatal error: Object of class classA could not be converted to string in %s on line %d -Incorrect input + Object of class classA could not be converted to string diff --cc ext/standard/tests/strings/strval_error.phpt index acf3cc623a,4e1ece6016..3cd76c5e15 --- a/ext/standard/tests/strings/strval_error.phpt +++ b/ext/standard/tests/strings/strval_error.phpt @@@ -16,15 -16,40 +16,19 @@@ class MyClas // no toString() method defined } -$string = "Hello"; -$extra_arg = 10; - -//Test strval with one more than the expected number of arguments -echo "\n-- Testing strval() function with more than expected no. of arguments --\n"; -var_dump( strval($string, $extra_arg) ); - -// Testing strval with one less than the expected number of arguments -echo "\n-- Testing strval() function with less than expected no. of arguments --\n"; -var_dump( strval() ); - // Testing strval with a object which has no toString() method echo "\n-- Testing strval() function with object which has not toString() method --\n"; - var_dump( strval(new MyClass()) ); + try { + var_dump( strval(new MyClass()) ); + } catch (Error $e) { + echo $e->getMessage(), "\n"; + } ?> ===DONE=== --EXPECTF-- *** Testing strval() : error conditions *** --- Testing strval() function with more than expected no. of arguments -- - -Warning: strval() expects exactly 1 parameter, 2 given in %s on line %d -NULL - --- Testing strval() function with less than expected no. of arguments -- - -Warning: strval() expects exactly 1 parameter, 0 given in %s on line %d -NULL - -- Testing strval() function with object which has not toString() method -- - - Recoverable fatal error: Object of class MyClass could not be converted to string in %s on line %d + Object of class MyClass could not be converted to string + ===DONE===