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

patch 9.0.2050: Vim9: crash with deferred function call and exception

Problem:  Vim9: crash with deferred function call and exception
Solution: Save and restore exception state

Crash when a deferred function is called after an exception and another
exception is thrown

closes: #13376
closes: #13377

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-10-19 10:52:34 +02:00
committed by Christian Brabandt
parent d7b616d0ad
commit c59c1e0d88
8 changed files with 106 additions and 50 deletions

View File

@@ -1088,6 +1088,19 @@ struct cleanup_stuff
except_T *exception; // exception value
};
/*
* Exception state that is saved and restored when calling timer callback
* functions and deferred functions.
*/
typedef struct exception_state_S exception_state_T;
struct exception_state_S
{
except_T *estate_current_exception;
int estate_did_throw;
int estate_need_rethrow;
int estate_trylevel;
};
#ifdef FEAT_SYN_HL
// struct passed to in_id_list()
struct sp_syn