diff options
author | Dmitry Stogov <dmitry@php.net> | 2005-11-24 11:33:27 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2005-11-24 11:33:27 +0000 |
commit | 4d7947e9ef2bd75c1520ced27a7e4abd3802660e (patch) | |
tree | dfde8c4a9fac63a29ba94a84d7bfceb8b687d882 | |
parent | db1be3a1db1584029981c043986e09ad35d5e536 (diff) | |
download | php-git-4d7947e9ef2bd75c1520ced27a7e4abd3802660e.tar.gz |
Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/zend_compile.c | 2 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 8 |
3 files changed, 11 insertions, 1 deletions
@@ -4,6 +4,8 @@ PHP NEWS - Fixed an error in mysqli_fetch_fields (returned NULL instead of an array when row number > field_count). (Georg) - Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus) +- Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash). + (Dmitry) - Fixed bug #35273 (Error in mapping soap - java types). (Dmitry) - Fixed bug #35239 (Objects can lose references). (Dmitry) - Fixed bug #35229 (call_user_func() crashes when arguement_stack is nearly diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c76f9d996e..ea278bf838 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1586,12 +1586,14 @@ void zend_do_mark_last_catch(znode *first_catch, znode *last_additional_catch TS } else { CG(active_op_array)->opcodes[last_additional_catch->u.opline_num].op1.u.EA.type = 1; } + DEC_BPC(CG(active_op_array)); } void zend_do_try(znode *try_token TSRMLS_DC) { try_token->u.opline_num = zend_add_try_element(get_next_op_number(CG(active_op_array)) TSRMLS_CC); + INC_BPC(CG(active_op_array)); } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 335ec97a69..bdae6a5ab1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1105,6 +1105,8 @@ void execute_new_code(TSRMLS_D) INIT_ZVAL(ret_opline->op1.u.constant); SET_UNUSED(ret_opline->op2); + zend_do_handle_exception(TSRMLS_C); + if (!CG(active_op_array)->start_op) { CG(active_op_array)->start_op = CG(active_op_array)->opcodes; } @@ -1143,7 +1145,11 @@ void execute_new_code(TSRMLS_D) zval_ptr_dtor(&local_retval); } - CG(active_op_array)->last--; /* get rid of that ZEND_RETURN */ + if (EG(exception)) { + zend_exception_error(EG(exception) TSRMLS_CC); + } + + CG(active_op_array)->last -= 2; /* get rid of that ZEND_RETURN and ZEND_HANDLE_EXCEPTION */ CG(active_op_array)->start_op = CG(active_op_array)->opcodes+CG(active_op_array)->last; } |