summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--Zend/zend_execute_API.c7
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 47b90c04d2..abc7ed152f 100644
--- a/NEWS
+++ b/NEWS
@@ -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);