Align error messages between normal VM and JIT for RW when using object as array (#12799)

This commit is contained in:
Gina Peter Banyard 2023-11-27 21:37:21 +00:00 committed by GitHub
parent d8ef868b92
commit e94ab0461c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1417,9 +1417,9 @@ static ZEND_COLD void zend_verify_missing_return_type(const zend_function *zf)
zend_verify_return_error(zf, NULL);
}
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_object_as_array(void)
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_object_as_array(const zend_object *object)
{
zend_throw_error(NULL, "Cannot use object as array");
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(object->ce->name));
}
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_illegal_offset(void)
@ -1487,7 +1487,7 @@ static zend_never_inline void zend_binary_assign_op_obj_dim(zend_object *obj, zv
}
zval_ptr_dtor(&res);
} else {
zend_use_object_as_array();
zend_use_object_as_array(obj);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_NULL(EX_VAR(opline->result.var));
}