mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0705: check did_throw before discarding exception #9808
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.
cae24be4a8
This commit is contained in:
parent
2bdc7cac8b
commit
c76494d8b7
@ -569,10 +569,12 @@ static void discard_exception(except_T *excp, int was_finished)
|
|||||||
*/
|
*/
|
||||||
void discard_current_exception(void)
|
void discard_current_exception(void)
|
||||||
{
|
{
|
||||||
discard_exception(current_exception, false);
|
if (current_exception != NULL) {
|
||||||
|
discard_exception(current_exception, false);
|
||||||
|
current_exception = NULL;
|
||||||
|
}
|
||||||
// Note: all globals manipulated here should be saved/restored in
|
// Note: all globals manipulated here should be saved/restored in
|
||||||
// try_enter/try_leave.
|
// try_enter/try_leave.
|
||||||
current_exception = NULL;
|
|
||||||
need_rethrow = false;
|
need_rethrow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1766,6 +1768,7 @@ void enter_cleanup(cleanup_T *csp)
|
|||||||
*/
|
*/
|
||||||
if (current_exception || need_rethrow) {
|
if (current_exception || need_rethrow) {
|
||||||
csp->exception = current_exception;
|
csp->exception = current_exception;
|
||||||
|
current_exception = NULL;
|
||||||
} else {
|
} else {
|
||||||
csp->exception = NULL;
|
csp->exception = NULL;
|
||||||
if (did_emsg) {
|
if (did_emsg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user