summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2012-10-04 08:38:56 +0100
committerDerick Rethans <github@derickrethans.nl>2012-10-04 08:38:56 +0100
commit61bee020e1fabc7ac8915025bff5e7b773382156 (patch)
tree3f45b89caedc1bfb06faccd66d1d8ed3ebfad512 /Zend/zend_execute_API.c
parent7101e9161c9c2bf9d843d1f412915e08072b198f (diff)
parent9b2303afd60eff6c9f3291bbe412c9734475b43a (diff)
downloadphp-git-61bee020e1fabc7ac8915025bff5e7b773382156.tar.gz
Merge branch 'master' of git.php.net:/php-src
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 1deee2a86c..ddf86e8008 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -31,6 +31,7 @@
#include "zend_extensions.h"
#include "zend_exceptions.h"
#include "zend_closures.h"
+#include "zend_generators.h"
#include "zend_vm.h"
#include "zend_float.h"
#ifdef HAVE_SYS_TIME_H
@@ -955,17 +956,15 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
EG(return_value_ptr_ptr) = fci->retval_ptr_ptr;
EG(active_op_array) = (zend_op_array *) EX(function_state).function;
original_opline_ptr = EG(opline_ptr);
- zend_execute(EG(active_op_array) TSRMLS_CC);
+
+ if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) {
+ *fci->retval_ptr_ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC);
+ } else {
+ zend_execute(EG(active_op_array) TSRMLS_CC);
+ }
+
if (!fci->symbol_table && EG(active_symbol_table)) {
- if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) {
- zend_hash_destroy(EG(active_symbol_table));
- FREE_HASHTABLE(EG(active_symbol_table));
- } else {
- /* clean before putting into the cache, since clean
- could call dtors, which could use cached hash */
- zend_hash_clean(EG(active_symbol_table));
- *(++EG(symtable_cache_ptr)) = EG(active_symbol_table);
- }
+ zend_clean_and_cache_symbol_table(EG(active_symbol_table) TSRMLS_CC);
}
EG(active_symbol_table) = calling_symbol_table;
EG(active_op_array) = original_op_array;