0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.0.0705: crash when there is an error in a timer callback

Problem:    Crash when there is an error in a timer callback. (Aron Griffis,
            Ozaki Kiichi)
Solution:   Check did_throw before discarding an exception.  NULLify
            current_exception when no longer valid.
This commit is contained in:
Bram Moolenaar
2017-07-10 22:12:10 +02:00
parent 163095f088
commit cae24be4a8
3 changed files with 11 additions and 3 deletions

View File

@@ -640,8 +640,11 @@ discard_exception(except_T *excp, int was_finished)
void
discard_current_exception(void)
{
discard_exception(current_exception, FALSE);
current_exception = NULL;
if (current_exception != NULL)
{
discard_exception(current_exception, FALSE);
current_exception = NULL;
}
did_throw = FALSE;
need_rethrow = FALSE;
}
@@ -1978,7 +1981,10 @@ enter_cleanup(cleanup_T *csp)
* there is an extra instance for every call of do_cmdline(), anyway.
*/
if (did_throw || need_rethrow)
{
csp->exception = current_exception;
current_exception = NULL;
}
else
{
csp->exception = NULL;