summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2013-11-27 20:30:35 +0400
committerDmitry Stogov <dmitry@zend.com>2013-11-27 20:30:35 +0400
commit43e3933fa3209c5b6fe9b69e2176146d71c8235f (patch)
tree1b0d4b160de5edcddea87f72265b8f68ba7ae6aa /Zend/zend_execute.c
parent5e8bb519f09c4f9c2ae00d5e9acb8e8d2b10a2d5 (diff)
downloadphp-git-43e3933fa3209c5b6fe9b69e2176146d71c8235f.tar.gz
Removed deprecated AI_SET_PTR()s
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 1870c5fcd9..5aea39ea94 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -102,16 +102,14 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
#define PZVAL_LOCK(z) Z_ADDREF_P((z))
#define SELECTIVE_PZVAL_LOCK(pzv, opline) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(pzv); }
-#define EXTRACT_ZVAL_PTR(t) do { \
- temp_variable *__t = (t); \
- if (__t->var.ptr_ptr) { \
- __t->var.ptr = *__t->var.ptr_ptr; \
- __t->var.ptr_ptr = &__t->var.ptr; \
- if (!PZVAL_IS_REF(__t->var.ptr) && \
- Z_REFCOUNT_P(__t->var.ptr) > 2) { \
- SEPARATE_ZVAL(__t->var.ptr_ptr); \
- } \
- } \
+#define EXTRACT_ZVAL_PTR(t) do { \
+ temp_variable *__t = (t); \
+ __t->var.ptr = *__t->var.ptr_ptr; \
+ __t->var.ptr_ptr = &__t->var.ptr; \
+ if (!PZVAL_IS_REF(__t->var.ptr) && \
+ Z_REFCOUNT_P(__t->var.ptr) > 2) { \
+ SEPARATE_ZVAL(__t->var.ptr_ptr); \
+ } \
} while (0)
#define AI_SET_PTR(t, val) do { \
@@ -1215,12 +1213,12 @@ convert_to_array:
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name);
}
}
- retval = &overloaded_result;
+ AI_SET_PTR(result, overloaded_result);
+ PZVAL_LOCK(overloaded_result);
} else {
- retval = &EG(error_zval_ptr);
+ result->var.ptr_ptr = &EG(error_zval_ptr);
+ PZVAL_LOCK(EG(error_zval_ptr));
}
- AI_SET_PTR(result, *retval);
- PZVAL_LOCK(*retval);
if (dim_type == IS_TMP_VAR) {
zval_ptr_dtor(&dim);
}
@@ -1237,8 +1235,8 @@ convert_to_array:
default:
if (type == BP_VAR_UNSET) {
zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
- AI_SET_PTR(result, &EG(uninitialized_zval));
- PZVAL_LOCK(&EG(uninitialized_zval));
+ result->var.ptr_ptr = &EG(uninitialized_zval_ptr);
+ PZVAL_LOCK(EG(uninitialized_zval_ptr));
} else {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
result->var.ptr_ptr = &EG(error_zval_ptr);
@@ -1256,12 +1254,12 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
case IS_ARRAY:
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC);
- AI_SET_PTR(result, *retval);
+ result->var.ptr = *retval;
PZVAL_LOCK(*retval);
return;
case IS_NULL:
- AI_SET_PTR(result, &EG(uninitialized_zval));
+ result->var.ptr = &EG(uninitialized_zval);
PZVAL_LOCK(&EG(uninitialized_zval));
return;
@@ -1314,7 +1312,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
Z_STRVAL_P(ptr)[1] = 0;
Z_STRLEN_P(ptr) = 1;
}
- AI_SET_PTR(result, ptr);
+ result->var.ptr = ptr;
return;
}
break;
@@ -1332,12 +1330,14 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
}
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
- if (overloaded_result) {
- AI_SET_PTR(result, overloaded_result);
- PZVAL_LOCK(overloaded_result);
- } else if (result) {
- AI_SET_PTR(result, &EG(uninitialized_zval));
- PZVAL_LOCK(&EG(uninitialized_zval));
+ if (result) {
+ if (overloaded_result) {
+ result->var.ptr = overloaded_result;
+ PZVAL_LOCK(overloaded_result);
+ } else {
+ result->var.ptr = &EG(uninitialized_zval);
+ PZVAL_LOCK(&EG(uninitialized_zval));
+ }
}
if (dim_type == IS_TMP_VAR) {
zval_ptr_dtor(&dim);
@@ -1346,7 +1346,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
return;
default:
- AI_SET_PTR(result, &EG(uninitialized_zval));
+ result->var.ptr = &EG(uninitialized_zval);
PZVAL_LOCK(&EG(uninitialized_zval));
return;
}