diff src/ex_eval.c @ 25889:c83ebae45881 v8.2.3478

patch 8.2.3478: still crash with error in :catch and also in :finally Commit: https://github.com/vim/vim/commit/f67d3fb7363ebc9454f9bb582de3978609a4fd6b Author: Bram Moolenaar <Bram@vim.org> Date: Tue Oct 5 11:22:27 2021 +0100 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 https://github.com/vim/vim/issues/8954)
author Bram Moolenaar <Bram@vim.org>
date Tue, 05 Oct 2021 12:30:04 +0200
parents a58520ab7c3b
children 892f937358ea
line wrap: on
line diff
--- 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