stas                                     Thu, 30 Jul 2009 05:01:53 +0000

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

Log:
fix for bug #49000

Bug: http://bugs.php.net/49000 (Analyzed) PHP CLI in Interactive mode (php -a) 
crashes when including files from function
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
    U   php/php-src/trunk/Zend/zend_execute_API.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2009-07-30 03:54:27 UTC (rev 286540)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-07-30 05:01:53 UTC (rev 286541)
@@ -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)

Modified: php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c        2009-07-30 
03:54:27 UTC (rev 286540)
+++ php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c        2009-07-30 
05:01:53 UTC (rev 286541)
@@ -1148,6 +1148,7 @@
                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 @@
                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 @@
 {
        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 @@

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

Modified: php/php-src/trunk/Zend/zend_execute_API.c
===================================================================
--- php/php-src/trunk/Zend/zend_execute_API.c   2009-07-30 03:54:27 UTC (rev 
286540)
+++ php/php-src/trunk/Zend/zend_execute_API.c   2009-07-30 05:01:53 UTC (rev 
286541)
@@ -1241,6 +1241,7 @@
                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;
@@ -1248,9 +1249,11 @@
                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);
@@ -1333,6 +1336,7 @@
 {
        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
@@ -1388,7 +1392,10 @@

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

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

Reply via email to