laruence                                 Fri, 02 Mar 2012 03:25:41 +0000

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

Log:
MFH: Fixed bug #60978 (exit code incorrect)

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

Modified: php/php-src/branches/PHP_5_4/NEWS
===================================================================
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-02 03:20:50 UTC (rev 323770)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-02 03:25:41 UTC (rev 323771)
@@ -11,6 +11,7 @@
     accessing a static property). (Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
     vars). (Laruence)
+  . Fixed bug #60978 (exit code incorrect). (Laruence)

 - Standard:
   . Fixed memory leak in substr_replace. (Pierrick)

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


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

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-03-02 
03:20:50 UTC (rev 323770)
+++ php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c        2012-03-02 
03:25:41 UTC (rev 323771)
@@ -1195,7 +1195,13 @@
                }
                CG(interactive) = 0;

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

                CG(interactive) = orig_interactive;
                if (local_retval_ptr) {

Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS      2012-03-02 03:20:50 UTC (rev 323770)
+++ php/php-src/trunk/NEWS      2012-03-02 03:25:41 UTC (rev 323771)
@@ -6,7 +6,6 @@
   . World domination

 - Core:
-  . Fixed bug #60978 (exit code incorrect). (Laruence)
   . Fixed bug #60573 (type hinting with "self" keyword causes weird errors).
     (Laruence)


Modified: php/php-src/trunk/Zend/tests/bug60978.phpt
===================================================================
--- php/php-src/trunk/Zend/tests/bug60978.phpt  2012-03-02 03:20:50 UTC (rev 
323770)
+++ php/php-src/trunk/Zend/tests/bug60978.phpt  2012-03-02 03:25:41 UTC (rev 
323771)
@@ -3,7 +3,7 @@
 --FILE--
 <?php
 $php = getenv('TEST_PHP_EXECUTABLE');
-exec($php . ' -r "exit(2);"', $output, $exit_code);
+exec($php . '-n -r "exit(2);"', $output, $exit_code);
 echo $exit_code;
 ?>
 --EXPECT--

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

Reply via email to