mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-28 11:25:44 +00:00
Fixed ArrayAccess handling
This commit is contained in:
1 parent
2eb980f614
commit
9727b47418
3 files changed
+40
-7
No files matched your search
+7
-7
@@ -1262,8 +1262,8 @@ convert_to_array:
|
||||
//??? }
|
||||
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC);
|
||||
|
||||
if (overloaded_result) {
|
||||
//??? if (!Z_ISREF_P(overloaded_result)) {
|
||||
if (overloaded_result && Z_TYPE_P(overloaded_result) != IS_UNDEF) {
|
||||
if (!Z_ISREF_P(overloaded_result)) {
|
||||
//??? if (Z_REFCOUNT_P(overloaded_result) > 0) {
|
||||
//??? zval *tmp = overloaded_result;
|
||||
//???
|
||||
@@ -1272,11 +1272,11 @@ convert_to_array:
|
||||
//??? Z_UNSET_ISREF_P(overloaded_result);
|
||||
//??? Z_SET_REFCOUNT_P(overloaded_result, 0);
|
||||
//??? }
|
||||
//??? if (Z_TYPE_P(overloaded_result) != IS_OBJECT) {
|
||||
//??? zend_class_entry *ce = Z_OBJCE_P(container);
|
||||
//??? zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name);
|
||||
//??? }
|
||||
//??? }
|
||||
if (Z_TYPE_P(overloaded_result) != IS_OBJECT) {
|
||||
zend_class_entry *ce = Z_OBJCE_P(container);
|
||||
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name->val);
|
||||
}
|
||||
}
|
||||
//??? AI_SET_PTR(result, overloaded_result);
|
||||
//??? PZVAL_LOCK(overloaded_result);
|
||||
//??? ZVAL_COPY(result, overloaded_result);
|
||||
|
||||
@@ -1661,6 +1661,9 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
|
||||
if (OP1_TYPE == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
zend_free_op free_op2;
|
||||
zval *property_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
@@ -15002,6 +15002,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
|
||||
zval *property_name = opline->op2.zv;
|
||||
@@ -17301,6 +17304,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
zend_free_op free_op2;
|
||||
zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
|
||||
@@ -19497,6 +19503,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
zend_free_op free_op2;
|
||||
zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
|
||||
@@ -21083,6 +21092,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
|
||||
zval *property_name = NULL;
|
||||
@@ -22881,6 +22893,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
|
||||
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
|
||||
zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
|
||||
@@ -32096,6 +32111,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
|
||||
zval *property_name = opline->op2.zv;
|
||||
@@ -34177,6 +34195,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
zend_free_op free_op2;
|
||||
zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
|
||||
@@ -36248,6 +36269,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
zend_free_op free_op2;
|
||||
zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
|
||||
@@ -37712,6 +37736,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
|
||||
zval *property_name = NULL;
|
||||
@@ -39372,6 +39399,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
|
||||
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(object_ptr) == IS_STR_OFFSET)) {
|
||||
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_REFERENCE) {
|
||||
object_ptr = Z_REFVAL_P(object_ptr);
|
||||
}
|
||||
if (Z_TYPE_P(object_ptr) == IS_OBJECT) {
|
||||
|
||||
zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
|
||||
|
||||
Reference in new issue
Block a user