diff options
| author | Dmitry Stogov <dmitry@php.net> | 2005-05-05 17:37:25 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2005-05-05 17:37:25 +0000 |
| commit | 79d6f11a4a3f6da55fa05b156fe8ff8accc3ff06 (patch) | |
| tree | 787b9e929b8f1f2f77e673879f516a0a47629381 /Zend/zend_compile.c | |
| parent | 929e3851f2ae5b28039fb014075354aa52966118 (diff) | |
| download | php-git-79d6f11a4a3f6da55fa05b156fe8ff8accc3ff06.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.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index de876333d0..3f79e44eb3 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -562,6 +562,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) { @@ -573,6 +579,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; @@ -796,13 +807,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; |
