laruence                                 Wed, 08 Feb 2012 03:03:05 +0000

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

Log:
Revert -r319102 and -r322922 in 5.4 branch since they introduce #60978
Fixed #60978 in trunk without reverting previous fix
#see http://news.php.net/php.internals/57789

Bug: https://bugs.php.net/60978 (Assigned) exit code incorrect
      
Changed paths:
    U   php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c
    U   php/php-src/trunk/NEWS
    A   php/php-src/trunk/Zend/tests/bug60978.phpt
    U   php/php-src/trunk/Zend/zend_execute_API.c

Modified: php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c
===================================================================
--- php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c        2012-02-07 
21:32:42 UTC (rev 323119)
+++ php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c        2012-02-08 
03:03:05 UTC (rev 323120)
@@ -1195,12 +1195,7 @@
                }
                CG(interactive) = 0;

-               retval = SUCCESS;
-               zend_try {
-                       zend_execute(new_op_array TSRMLS_CC);
-               } zend_catch {
-                       retval = FAILURE;
-               } zend_end_try();
+               zend_execute(new_op_array TSRMLS_CC);

                CG(interactive) = orig_interactive;
                if (local_retval_ptr) {
@@ -1221,6 +1216,7 @@
                destroy_op_array(new_op_array TSRMLS_CC);
                efree(new_op_array);
                EG(return_value_ptr_ptr) = original_return_value_ptr_ptr;
+               retval = SUCCESS;
        } else {
                retval = FAILURE;
        }

Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS      2012-02-07 21:32:42 UTC (rev 323119)
+++ php/php-src/trunk/NEWS      2012-02-08 03:03:05 UTC (rev 323120)
@@ -8,6 +8,7 @@
 - Core:
   . Fixed bug #60573 (type hinting with "self" keyword causes weird errors).
     (Laruence)
+  . Fixed bug #60978 (exit code incorrect). (Laruence)

 - cURL:
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,

Added: php/php-src/trunk/Zend/tests/bug60978.phpt
===================================================================
--- php/php-src/trunk/Zend/tests/bug60978.phpt                          (rev 0)
+++ php/php-src/trunk/Zend/tests/bug60978.phpt  2012-02-08 03:03:05 UTC (rev 
323120)
@@ -0,0 +1,10 @@
+--TEST--
+Bug #60978 (exit code incorrect)
+--FILE--
+<?php
+$php = getenv('TEST_PHP_EXECUTABLE');
+exec($php . ' -r "exit(2);"', $output, $exit_code);
+echo $exit_code;
+?>
+--EXPECT--
+2


Property changes on: php/php-src/trunk/Zend/tests/bug60978.phpt
___________________________________________________________________
Added: svn:executable
   + *

Modified: php/php-src/trunk/Zend/zend_execute_API.c
===================================================================
--- php/php-src/trunk/Zend/zend_execute_API.c   2012-02-07 21:32:42 UTC (rev 
323119)
+++ php/php-src/trunk/Zend/zend_execute_API.c   2012-02-08 03:03:05 UTC (rev 
323120)
@@ -1195,11 +1195,12 @@
                }
                CG(interactive) = 0;

-               retval = SUCCESS;
                zend_try {
                        zend_execute(new_op_array TSRMLS_CC);
                } zend_catch {
-                       retval = FAILURE;
+                       destroy_op_array(new_op_array TSRMLS_CC);
+                       efree(new_op_array);
+                       zend_bailout();
                } zend_end_try();

                CG(interactive) = orig_interactive;
@@ -1221,6 +1222,7 @@
                destroy_op_array(new_op_array TSRMLS_CC);
                efree(new_op_array);
                EG(return_value_ptr_ptr) = original_return_value_ptr_ptr;
+               retval = SUCCESS;
        } else {
                retval = FAILURE;
        }

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

Reply via email to