summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-05-05 17:36:53 +0000
committerDmitry Stogov <dmitry@php.net>2005-05-05 17:36:53 +0000
commit89511b316a6e1c2e46c76a0bc1acb51a46247731 (patch)
tree3fe784e2382b5d7093a9d77e2542d0c2134768d6 /Zend/zend_compile.c
parentfbe44d03459d9f606bbd7973213f70cbfac6a23f (diff)
downloadphp-git-89511b316a6e1c2e46c76a0bc1acb51a46247731.tar.gz
Fixed bug #31525 (object reference being dropped. $this getting lost)
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index a9bcaf5f55..b1805298f7 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -483,6 +483,12 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
}
}
+static inline zend_bool zend_is_function_or_method_call(znode *variable)
+{
+ zend_uint type = variable->u.EA.type;
+
+ return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
+}
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
{
@@ -494,6 +500,11 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
if (opline_is_fetch_this(last_op TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
}
+ if (zend_is_function_or_method_call(rvar)) {
+ opline->extended_value = ZEND_RETURNS_FUNCTION;
+ } else {
+ opline->extended_value = 0;
+ }
if (result) {
opline->result.op_type = IS_VAR;
opline->result.u.EA.type = 0;
@@ -717,13 +728,6 @@ void zend_check_writable_variable(znode *variable)
}
}
-static inline zend_bool zend_is_function_or_method_call(znode *variable)
-{
- zend_uint type = variable->u.EA.type;
-
- return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
-}
-
void zend_do_begin_variable_parse(TSRMLS_D)
{
zend_llist fetch_list;