diff options
| author | Nikita Popov <nikic@php.net> | 2012-05-19 20:19:45 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2012-05-19 20:19:45 +0200 |
| commit | e14cfafcbfbe58e0fc3f7b814698a908b0dffca5 (patch) | |
| tree | df480de9c03dcd3489a6563b7e68bacfb26d3101 /Zend/zend_compile.c | |
| parent | fd2a109f86d18b93d29153c2ddfa605651c7df05 (diff) | |
| download | php-git-e14cfafcbfbe58e0fc3f7b814698a908b0dffca5.tar.gz | |
Add zend_do_suspend_if_generator calls
The execution of generator functions will be suspended right after the
arguments were RECVed. This will be done in zend_do_suspend_if_generator.
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d2b3536788..831f9f9d3f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2668,6 +2668,17 @@ void zend_do_yield(znode *expr TSRMLS_DC) /* {{{ */ } /* }}} */ +void zend_do_suspend_if_generator(TSRMLS_D) /* {{{ */ +{ + // we only suspend execution if the current function is a generator + if ((CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) == 0) { + return; + } + + /* do nothing for now */ +} +/* }}} */ + static int zend_add_try_element(zend_uint try_op TSRMLS_DC) /* {{{ */ { int try_catch_offset = CG(active_op_array)->last_try_catch++; |
