diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-07-02 23:29:53 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-07-02 23:29:53 +0400 |
commit | 63c057e3313918a800ad7faebdb648216ddba4c0 (patch) | |
tree | 04ede4c58aa008868e82606b16cafc9d51757f87 /Zend/zend.c | |
parent | 4b09dd69e6bd31f4010bf48e9e07e63cb5f3c2a4 (diff) | |
download | php-git-63c057e3313918a800ad7faebdb648216ddba4c0.tar.gz |
Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data)
Diffstat (limited to 'Zend/zend.c')
-rw-r--r-- | Zend/zend.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 1d77665bc2..68ed5c9fd1 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -938,7 +938,7 @@ void zend_call_destructors(TSRMLS_D) /* {{{ */ ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */ { /* we're no longer executing anything */ - EG(opline_ptr) = NULL; + EG(current_execute_data) = NULL; EG(active_symbol_table) = NULL; zend_try { @@ -1042,6 +1042,9 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ /* Report about uncaught exception in case of fatal errors */ if (EG(exception)) { + zend_execute_data *ex; + zend_op *opline; + switch (type) { case E_CORE_ERROR: case E_ERROR: @@ -1049,13 +1052,19 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ case E_PARSE: case E_COMPILE_ERROR: case E_USER_ERROR: - if (zend_is_executing(TSRMLS_C)) { - error_lineno = zend_get_executed_lineno(TSRMLS_C); + ex = EG(current_execute_data); + opline = NULL; + while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { + ex = ex->prev_execute_data; + } + if (ex && ex->opline && ex->opline->opcode == ZEND_HANDLE_EXCEPTION && + EG(opline_before_exception)) { + opline = EG(opline_before_exception); } zend_exception_error(EG(exception), E_WARNING TSRMLS_CC); EG(exception) = NULL; - if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) { - active_opline->lineno = error_lineno; + if (opline) { + ex->opline = opline; } break; default: |