diff options
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 831f9f9d3f..f0802efd58 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2670,12 +2670,18 @@ void zend_do_yield(znode *expr TSRMLS_DC) /* {{{ */ void zend_do_suspend_if_generator(TSRMLS_D) /* {{{ */ { + zend_op *opline; + // 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 */ + opline = get_next_op(CG(active_op_array) TSRMLS_CC); + + opline->opcode = ZEND_SUSPEND_AND_RETURN_GENERATOR; + SET_UNUSED(opline->op1); + SET_UNUSED(opline->op2); } /* }}} */ |
