diff options
author | Dmitry Stogov <dmitry@php.net> | 2008-05-07 12:04:39 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2008-05-07 12:04:39 +0000 |
commit | 5521912b153ab6fd457ea4ce9ea3a7656f09b038 (patch) | |
tree | ce1c781483813dcac626a29f2c6604b5f0680574 /Zend/zend_execute_API.c | |
parent | 06cef68307f3f02d1bc1d961d5985b85fca379f6 (diff) | |
download | php-git-5521912b153ab6fd457ea4ce9ea3a7656f09b038.tar.gz |
Use IS_CV for dirrent access to $this variable
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r-- | Zend/zend_execute_API.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index c35d902ec5..929828654b 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1811,12 +1811,13 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */ } if (EG(current_execute_data) && EG(current_execute_data)->op_array) { EG(current_execute_data)->symbol_table = EG(active_symbol_table); - if (EG(current_execute_data)->op_array->uses_this && EG(This)) { - Z_ADDREF_P(EG(This)); /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - Z_DELREF_P(EG(This)); - } - } + + if (EG(current_execute_data)->op_array->this_var != -1 && + !EG(current_execute_data)->CVs[EG(current_execute_data)->op_array->this_var] && + EG(This)) { + EG(current_execute_data)->CVs[EG(current_execute_data)->op_array->this_var] = (zval**)EG(current_execute_data)->CVs + EG(current_execute_data)->op_array->last_var + EG(current_execute_data)->op_array->this_var; + *EG(current_execute_data)->CVs[EG(current_execute_data)->op_array->this_var] = EG(This); + } for (i = 0; i < EG(current_execute_data)->op_array->last_var; i++) { if (EG(current_execute_data)->CVs[i]) { zend_hash_quick_update(EG(active_symbol_table), |