vim-patch:8.2.3470: crash with error in :catch and also in :finally

Problem:    Crash with error in :catch and also in :finally.
Solution:   Only discard an exception if there is one. (closes vim/vim#8954)
a684a68409
This commit is contained in:
Sean Dewar
2021-10-09 02:13:49 +01:00
committed by zeertzjq
parent 93c72d866b
commit a25c35d6e4
2 changed files with 13 additions and 1 deletions

View File

@@ -1913,7 +1913,7 @@ int cleanup_conditionals(cstack_T *cstack, int searched_cond, int inclusive)
default:
if (cstack->cs_flags[idx] & CSF_FINALLY) {
if (cstack->cs_pending[idx] & CSTP_THROW) {
if ((cstack->cs_pending[idx] & CSTP_THROW) && cstack->cs_exception[idx] != NULL) {
// Cancel the pending exception. This is in the
// finally clause, so that the stack of the
// caught exceptions is not involved.