diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2016-02-17 20:26:47 +0100 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2016-02-17 20:27:46 +0100 |
commit | 055b4112188cccdc250790ab063479d2922f5fda (patch) | |
tree | c44f668b32efacdba63a55b3ad8ce011e743abf7 /sapi/phpdbg/phpdbg_bp.c | |
parent | d2287529396539fd2cba6f449ae9679cac64c3b9 (diff) | |
download | php-git-055b4112188cccdc250790ab063479d2922f5fda.tar.gz |
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
Diffstat (limited to 'sapi/phpdbg/phpdbg_bp.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_bp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index eac67d4ac7..5436bda5db 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -563,12 +563,14 @@ PHPDBG_API int phpdbg_resolve_opline_break(phpdbg_breakopline_t *new_break) /* { } else { zend_execute_data *execute_data = EG(current_execute_data); do { - zend_op_array *op_array = &execute_data->func->op_array; - if (op_array->function_name == NULL && op_array->scope == NULL && new_break->class_len == ZSTR_LEN(op_array->filename) && !memcmp(ZSTR_VAL(op_array->filename), new_break->class_name, new_break->class_len)) { - if (phpdbg_resolve_op_array_break(new_break, op_array) == SUCCESS) { - return SUCCESS; - } else { - return 2; + if (ZEND_USER_CODE(execute_data->func->common.type)) { + zend_op_array *op_array = &execute_data->func->op_array; + if (op_array->function_name == NULL && op_array->scope == NULL && new_break->class_len == ZSTR_LEN(op_array->filename) && !memcmp(ZSTR_VAL(op_array->filename), new_break->class_name, new_break->class_len)) { + if (phpdbg_resolve_op_array_break(new_break, op_array) == SUCCESS) { + return SUCCESS; + } else { + return 2; + } } } } while ((execute_data = execute_data->prev_execute_data) != NULL); |