summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-03 20:30:49 +0200
committerAnatol Belski <ab@php.net>2014-10-03 20:30:49 +0200
commitee4ae7fbc3ba6de5f51f95a621e14a18dd55c95d (patch)
treed774f5b506e70bc8a70ef22988e2d374bf0756b8 /Zend/zend_API.c
parent45e23645a42ba939fb1cca9cc099f977af2a4722 (diff)
parent1ff094deb481234c0aa2fb5b0ee144b7aba924ff (diff)
downloadphp-git-ee4ae7fbc3ba6de5f51f95a621e14a18dd55c95d.tar.gz
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: remove the remains of dsp files handling fix EX usage remove misprint parentheses remove misprint parentheses Replaced EG(This) and EX(object) with EX(This). Internal functions now recieves zend_execute_data as the first argument. And this one... It should be in extern c Remove useless condition NEWS entry for previous commit NEWS entry for previous commit add IPv6 support to php-fpm Micro optimization for the most frequency case Add hash to EXTENSIONS file Remove extensions which are long gone we also have xz release tarballs since 5.5 Fix ZTS build improved file size computation in stat() Fixed incorrect compilation 5.5.19 now
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c69
1 files changed, 51 insertions, 18 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 770eeba78b..82864f2a46 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2850,8 +2850,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
} else {
fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
fcc->calling_scope = EG(scope);
- if (!fcc->object && Z_OBJ(EG(This))) {
- fcc->object = Z_OBJ(EG(This));
+ if (!fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This)) {
+ fcc->object = Z_OBJ(EG(current_execute_data)->This);
}
ret = 1;
}
@@ -2863,8 +2863,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
} else {
fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
fcc->calling_scope = EG(scope)->parent;
- if (!fcc->object && Z_OBJ(EG(This))) {
- fcc->object = Z_OBJ(EG(This));
+ if (!fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This)) {
+ fcc->object = Z_OBJ(EG(current_execute_data)->This);
}
*strict_class = 1;
ret = 1;
@@ -2875,8 +2875,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
} else {
fcc->called_scope = EG(current_execute_data)->called_scope;
fcc->calling_scope = EG(current_execute_data)->called_scope;
- if (!fcc->object && Z_OBJ(EG(This))) {
- fcc->object = Z_OBJ(EG(This));
+ if (!fcc->object && Z_OBJ(EG(current_execute_data)->This)) {
+ fcc->object = Z_OBJ(EG(current_execute_data)->This);
}
*strict_class = 1;
ret = 1;
@@ -2890,11 +2890,11 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
}
scope = ex ? ex->func->common.scope : NULL;
fcc->calling_scope = ce;
- if (scope && !fcc->object && Z_OBJ(EG(This)) &&
- instanceof_function(Z_OBJCE(EG(This)), scope TSRMLS_CC) &&
+ if (scope && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) &&
+ instanceof_function(Z_OBJCE(EG(current_execute_data)->This), scope TSRMLS_CC) &&
instanceof_function(scope, fcc->calling_scope TSRMLS_CC)) {
- fcc->object = Z_OBJ(EG(This));
- fcc->called_scope = Z_OBJCE(EG(This));
+ fcc->object = Z_OBJ(EG(current_execute_data)->This);
+ fcc->called_scope = Z_OBJCE(EG(current_execute_data)->This);
} else {
fcc->called_scope = fcc->object ? zend_get_class_entry(fcc->object TSRMLS_CC) : fcc->calling_scope;
}
@@ -3095,10 +3095,10 @@ get_function_via_handler:
if (fcc->function_handler) {
retval = 1;
call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
- if (call_via_handler && !fcc->object && Z_OBJ(EG(This)) &&
- Z_OBJ_HT(EG(This))->get_class_entry &&
- instanceof_function(Z_OBJCE(EG(This)), fcc->calling_scope TSRMLS_CC)) {
- fcc->object = Z_OBJ(EG(This));
+ if (call_via_handler && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) &&
+ Z_OBJ_HT(EG(current_execute_data)->This)->get_class_entry &&
+ instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) {
+ fcc->object = Z_OBJ(EG(current_execute_data)->This);
}
}
}
@@ -3127,15 +3127,15 @@ get_function_via_handler:
if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) {
retval = 0;
}
- if (Z_OBJ(EG(This)) && instanceof_function(Z_OBJCE(EG(This)), fcc->calling_scope TSRMLS_CC)) {
- fcc->object = Z_OBJ(EG(This));
+ if (EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) {
+ fcc->object = Z_OBJ(EG(current_execute_data)->This);
if (error) {
- zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(This))->name->val);
+ zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val);
if (severity == E_ERROR) {
retval = 0;
}
} else if (retval) {
- zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(This))->name->val);
+ zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val);
}
} else {
if (error) {
@@ -4143,6 +4143,39 @@ ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_functi
}
/* }}} */
+ZEND_API void zend_ctor_make_null(zend_execute_data *execute_data) /* {{{ */
+{
+ if (EX(return_value)) {
+/*
+ if (Z_TYPE_P(EX(return_value)) == IS_OBJECT) {
+ zend_object *object = Z_OBJ_P(EX(return_value));
+ zend_execute_data *ex = EX(prev_execute_data);
+
+ while (ex && Z_OBJ(ex->This) == object) {
+ if (ex->func) {
+ if (ZEND_USER_CODE(ex->func->type)) {
+ if (ex->func->op_array.this_var != -1) {
+ zval *this_var = EX_VAR_2(ex, ex->func->op_array.this_var);
+ if (this_var != EX(return_value)) {
+ zval_ptr_dtor(this_var);
+ ZVAL_NULL(this_var);
+ }
+ }
+ }
+ }
+ Z_OBJ(ex->This) = NULL;
+ ZVAL_NULL(&ex->This);
+ ex = ex->prev_execute_data;
+ }
+ }
+*/
+ zval_ptr_dtor(EX(return_value));
+ Z_OBJ_P(EX(return_value)) = NULL;
+ ZVAL_NULL(EX(return_value));
+ }
+}
+/* }}} */
+
/*
* Local variables:
* tab-width: 4