From f83ee6a05d9b0213ba43831a5c55ad7992a825c0 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 21 Apr 2015 12:31:43 +0200 Subject: Add next command / Fix recursion/exceptions with u/F/L --- sapi/phpdbg/phpdbg_utils.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'sapi/phpdbg/phpdbg_utils.c') diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c index a4725bd744..e1f6c59502 100644 --- a/sapi/phpdbg/phpdbg_utils.c +++ b/sapi/phpdbg/phpdbg_utils.c @@ -712,3 +712,25 @@ head_done: } } phpdbg_end_try_access(); } + +PHPDBG_API zend_bool phpdbg_check_caught_ex(zend_execute_data *ex) { + const zend_op *op; + uint32_t op_num, i; + zend_op_array *op_array = &ex->func->op_array; + + if (ex->opline >= EG(exception_op) && ex->opline < EG(exception_op) + 3) { + op = EG(opline_before_exception); + } else { + op = ex->opline; + } + + op_num = op - op_array->opcodes; + + for (i = 0; i < op_array->last_try_catch && op_array->try_catch_array[i].try_op > op_num; i++) { + if (op_num < op_array->try_catch_array[i].catch_op || op_num < op_array->try_catch_array[i].finally_op) { + return 1; + } + } + + return 0; +} -- cgit v1.2.1