mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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:
@@ -1235,7 +1235,7 @@ check_due_timer(void)
|
|||||||
if (called_emsg)
|
if (called_emsg)
|
||||||
{
|
{
|
||||||
++timer->tr_emsg_count;
|
++timer->tr_emsg_count;
|
||||||
if (!did_throw_save && current_exception != NULL)
|
if (!did_throw_save && did_throw && current_exception != NULL)
|
||||||
discard_current_exception();
|
discard_current_exception();
|
||||||
}
|
}
|
||||||
did_emsg = did_emsg_save;
|
did_emsg = did_emsg_save;
|
||||||
|
@@ -639,9 +639,12 @@ discard_exception(except_T *excp, int was_finished)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
discard_current_exception(void)
|
discard_current_exception(void)
|
||||||
|
{
|
||||||
|
if (current_exception != NULL)
|
||||||
{
|
{
|
||||||
discard_exception(current_exception, FALSE);
|
discard_exception(current_exception, FALSE);
|
||||||
current_exception = NULL;
|
current_exception = NULL;
|
||||||
|
}
|
||||||
did_throw = FALSE;
|
did_throw = FALSE;
|
||||||
need_rethrow = 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.
|
* there is an extra instance for every call of do_cmdline(), anyway.
|
||||||
*/
|
*/
|
||||||
if (did_throw || need_rethrow)
|
if (did_throw || need_rethrow)
|
||||||
|
{
|
||||||
csp->exception = current_exception;
|
csp->exception = current_exception;
|
||||||
|
current_exception = NULL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
csp->exception = NULL;
|
csp->exception = NULL;
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
705,
|
||||||
/**/
|
/**/
|
||||||
704,
|
704,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user