From a684a684096ecef3fbaee39c573b47423235d6b1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 4 Oct 2021 18:52:19 +0100 Subject: 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 #8954) --- src/ex_eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ex_eval.c') 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 -- cgit v1.2.3