diff options
author | Stefan Marr <gron@php.net> | 2010-06-08 15:56:36 +0000 |
---|---|---|
committer | Stefan Marr <gron@php.net> | 2010-06-08 15:56:36 +0000 |
commit | e6bd5368ad144267c2b7263d84b7d2159c3d2548 (patch) | |
tree | 2cfe42d0ca4830eaeffa5d800577085cbdfb3e60 /Zend/zend_closures.c | |
parent | df3b9225fd219583865f2d053e37c54863362c33 (diff) | |
download | php-git-e6bd5368ad144267c2b7263d84b7d2159c3d2548.tar.gz |
Fixed issue with statics in traits.
#Please review this change, I moved the routine which copies statics from the closure code to zend_variables.c
#Please also have a look to check whether the TSRMLS_DC is correct, and whether it fits with the rest in zend_variables, because there you are using some macro magic and I am not exactly sure what the reason is for that.
Diffstat (limited to 'Zend/zend_closures.c')
-rw-r--r-- | Zend/zend_closures.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 20cbd90669..b40b9222db 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -398,43 +398,6 @@ void zend_register_closure_ce(TSRMLS_D) /* {{{ */ } /* }}} */ -static int zval_copy_static_var(zval **p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */ -{ - HashTable *target = va_arg(args, HashTable*); - zend_bool is_ref; - - if (Z_TYPE_PP(p) & (IS_LEXICAL_VAR|IS_LEXICAL_REF)) { - is_ref = Z_TYPE_PP(p) & IS_LEXICAL_REF; - - if (!EG(active_symbol_table)) { - zend_rebuild_symbol_table(TSRMLS_C); - } - if (zend_hash_quick_find(EG(active_symbol_table), key->arKey, key->nKeyLength, key->h, (void **) &p) == FAILURE) { - if (is_ref) { - zval *tmp; - - ALLOC_INIT_ZVAL(tmp); - Z_SET_ISREF_P(tmp); - zend_hash_quick_add(EG(active_symbol_table), key->arKey, key->nKeyLength, key->h, &tmp, sizeof(zval*), (void**)&p); - } else { - p = &EG(uninitialized_zval_ptr); - zend_error(E_NOTICE,"Undefined variable: %s", key->arKey); - } - } else { - if (is_ref) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(p); - } else if (Z_ISREF_PP(p)) { - SEPARATE_ZVAL(p); - } - } - } - if (zend_hash_quick_add(target, key->arKey, key->nKeyLength, key->h, p, sizeof(zval*), NULL) == SUCCESS) { - Z_ADDREF_PP(p); - } - return ZEND_HASH_APPLY_KEEP; -} -/* }}} */ - ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zval *this_ptr TSRMLS_DC) /* {{{ */ { zend_closure *closure; |