summaryrefslogtreecommitdiffstats
path: root/src/ex_eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-10-04 18:52:19 +0100
committerBram Moolenaar <Bram@vim.org>2021-10-04 18:52:19 +0100
commita684a684096ecef3fbaee39c573b47423235d6b1 (patch)
tree387ee22bdbd6a9d0483b695cb09686c7af9b1fa2 /src/ex_eval.c
parent50c56893423eb6ad2154a4151e67f7097f52efb6 (diff)
patch 8.2.3470: crash with error in :catch and also in :finallyv8.2.3470
Problem: Crash with error in :catch and also in :finally. Solution: Only discard an exception if there is one. (closes #8954)
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r--src/ex_eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c
index 259cf670cc..503a3ae02a 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -2374,7 +2374,8 @@ cleanup_conditionals(
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