jani                                     Mon, 31 Aug 2009 12:07:27 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=287915

Log:
MF53: - Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes when 
including files from function), see also bug #49405

Bugs: http://bugs.php.net/49000 (Closed) PHP CLI in Interactive mode (php -a) 
crashes when including files from function
      http://bugs.php.net/49405 (Open) PHP CLI (php -a) does not function 
correctly on include and related functions.
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2009-08-31 08:52:03 UTC (rev 287914)
+++ php/php-src/branches/PHP_5_2/NEWS   2009-08-31 12:07:27 UTC (rev 287915)
@@ -13,6 +13,8 @@
 - 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)


Modified: php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c
===================================================================
--- php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c        2009-08-31 
08:52:03 UTC (rev 287914)
+++ php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c        2009-08-31 
12:07:27 UTC (rev 287915)
@@ -1212,13 +1212,16 @@
                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 @@
        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 @@

        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);
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to