MFH: Fixed bug #60978 (exit code incorrect)

This commit is contained in:
Xinchen Hui 2012-03-02 03:25:41 +00:00
parent 2e5e82a8ca
commit 5f99d789b5
3 changed files with 18 additions and 1 deletions

1
NEWS
View File

@ -11,6 +11,7 @@ PHP NEWS
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)

10
Zend/tests/bug60978.phpt Executable file
View File

@ -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

View File

@ -1195,7 +1195,13 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
}
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) {