diff options
author | Stanislav Malyshev <stas@php.net> | 2009-07-30 05:01:53 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2009-07-30 05:01:53 +0000 |
commit | 9fd8469e94176e1d14bcd75f6bc23d85f472e24b (patch) | |
tree | 8defa75a6ccb4613e85db3e01f21bde83b50e7b4 | |
parent | fa09704cea254112bc69706dd637bd7fdeb459d5 (diff) | |
download | php-git-9fd8469e94176e1d14bcd75f6bc23d85f472e24b.tar.gz |
fix for bug #49000
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 7 |
2 files changed, 9 insertions, 0 deletions
@@ -26,6 +26,8 @@ (Greg) - Fixed bug #49014 (dechunked filter broken when serving more than 8192 bytes in a chunk). (andreas dot streichardt at globalpark dot com, Ilia) +- Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes + when including files from function). (Stas) - Fixed bug #48980 (Crash when compiling with pdo_firebird). (Felipe) - Fixed bug #48962 (cURL does not upload files with specified filename). (Ilia) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 6b51eb156c..935133da11 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1148,6 +1148,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s zval *local_retval_ptr=NULL; zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr); zend_op **original_opline_ptr = EG(opline_ptr); + int orig_interactive = CG(interactive); EG(return_value_ptr_ptr) = &local_retval_ptr; EG(active_op_array) = new_op_array; @@ -1155,9 +1156,11 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s if (!EG(active_symbol_table)) { zend_rebuild_symbol_table(TSRMLS_C); } + CG(interactive) = 0; zend_execute(new_op_array TSRMLS_CC); + CG(interactive) = orig_interactive; if (local_retval_ptr) { if (retval_ptr) { COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr); @@ -1216,6 +1219,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */ { zend_op *opline, *end; zend_op *ret_opline; + int orig_interactive; if (!(CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) || CG(active_op_array)->backpatch_count>0 @@ -1271,7 +1275,10 @@ void execute_new_code(TSRMLS_D) /* {{{ */ EG(return_value_ptr_ptr) = NULL; EG(active_op_array) = CG(active_op_array); + orig_interactive = CG(interactive); + CG(interactive) = 0; zend_execute(CG(active_op_array) TSRMLS_CC); + CG(interactive) = orig_interactive; if (EG(exception)) { zend_exception_error(EG(exception), E_ERROR TSRMLS_CC); |