From f67d3fb7363ebc9454f9bb582de3978609a4fd6b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 5 Oct 2021 11:22:27 +0100 Subject: patch 8.2.3478: still crash with error in :catch and also in :finally Problem: Still crash with error in :catch and also in :finally. Solution: Only call finish_exception() once. (closes #8954) --- src/ex_eval.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ex_eval.c') diff --git a/src/ex_eval.c b/src/ex_eval.c index 503a3ae02a..ee6816a396 100644 --- a/src/ex_eval.c +++ b/src/ex_eval.c @@ -2401,8 +2401,12 @@ cleanup_conditionals( if (!(cstack->cs_flags[idx] & CSF_FINALLY)) { if ((cstack->cs_flags[idx] & CSF_ACTIVE) - && (cstack->cs_flags[idx] & CSF_CAUGHT)) + && (cstack->cs_flags[idx] & CSF_CAUGHT) + && !(cstack->cs_flags[idx] & CSF_FINISHED)) + { finish_exception((except_T *)cstack->cs_exception[idx]); + cstack->cs_flags[idx] |= CSF_FINISHED; + } // Stop at this try conditional - except the try block never // got active (because of an inactive surrounding conditional // or when the ":try" appeared after an error or interrupt or -- cgit v1.2.3