diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-10-05 11:22:27 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-05 11:22:27 +0100 |
commit | f67d3fb7363ebc9454f9bb582de3978609a4fd6b (patch) | |
tree | fa58a3c641caea17cf12301143c6c75a42060c75 /src/ex_eval.c | |
parent | 6d197987745427801a2195836ef89e48537afbeb (diff) | |
download | vim-git-f67d3fb7363ebc9454f9bb582de3978609a4fd6b.tar.gz |
patch 8.2.3478: still crash with error in :catch and also in :finallyv8.2.3478
Problem: Still crash with error in :catch and also in :finally.
Solution: Only call finish_exception() once. (closes #8954)
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r-- | src/ex_eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c index 503a3ae02..ee6816a39 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 |