From 055b4112188cccdc250790ab063479d2922f5fda Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Wed, 17 Feb 2016 20:26:47 +0100 Subject: Fix crash when advancing inside an internal function This just happened in the "double ctrl+c" mode, when we halted inside an internal function; there was some code assuming a proper op_array --- sapi/phpdbg/phpdbg_utils.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sapi/phpdbg/phpdbg_utils.h') diff --git a/sapi/phpdbg/phpdbg_utils.h b/sapi/phpdbg/phpdbg_utils.h index 2bd4f35d71..4ba756139b 100644 --- a/sapi/phpdbg/phpdbg_utils.h +++ b/sapi/phpdbg/phpdbg_utils.h @@ -99,6 +99,14 @@ char *phpdbg_short_zval_print(zval *zv, int maxlen); PHPDBG_API zend_bool phpdbg_check_caught_ex(zend_execute_data *ex, zend_object *exception); +static zend_always_inline zend_execute_data *phpdbg_user_execute_data(zend_execute_data *ex) { + while (!ex->func || !ZEND_USER_CODE(ex->func->common.type)) { + ex = ex->prev_execute_data; + ZEND_ASSERT(ex); + } + return ex; +} + #ifdef ZTS #define PHPDBG_OUTPUT_BACKUP_DEFINES() \ zend_output_globals *output_globals_ptr; \ -- cgit v1.2.1