summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2009-08-31 12:07:27 +0000
committerJani Taskinen <jani@php.net>2009-08-31 12:07:27 +0000
commit780bda4ce117ccae074573bad3d928b371505a72 (patch)
tree7dc396425d776a97a809a8e193098731e84cd3a8
parent58aeff197820dbdcaf21dbe0a77ad5657691e3f0 (diff)
downloadphp-git-780bda4ce117ccae074573bad3d928b371505a72.tar.gz
MF53: - Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes when including files from function), see also bug #49405
-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 e47f75cb34..217285beb5 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,8 @@ PHP NEWS
- Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani)
- Fixed bug #49144 (Import of schema from different host transmits original
authentication details). (Dmitry)
+- Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes when including
+ files from function). (Stas)
- Fixed bug #47273 (Encoding bug in SoapServer->fault). (Dmitry)
- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett)
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 0e64a41c1c..b403ff708a 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1212,13 +1212,16 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR
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;
EG(no_extensions)=1;
+ 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);
@@ -1265,6 +1268,7 @@ void execute_new_code(TSRMLS_D)
zend_op *opline, *end;
zend_op *ret_opline;
zval *local_retval=NULL;
+ int orig_interactive;
if (!(CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE)
|| CG(active_op_array)->backpatch_count>0
@@ -1314,7 +1318,10 @@ void execute_new_code(TSRMLS_D)
EG(return_value_ptr_ptr) = &local_retval;
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 (local_retval) {
zval_ptr_dtor(&local_retval);
}