Mercurial > vim
comparison src/ex_eval.c @ 25872:a58520ab7c3b v8.2.3470
patch 8.2.3470: crash with error in :catch and also in :finally
Commit: https://github.com/vim/vim/commit/a684a684096ecef3fbaee39c573b47423235d6b1
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 4 18:52:19 2021 +0100
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 https://github.com/vim/vim/issues/8954)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 04 Oct 2021 20:00:06 +0200 |
parents | 8556ded8a462 |
children | c83ebae45881 |
comparison
equal
deleted
inserted
replaced
25871:8a00c3caf60d | 25872:a58520ab7c3b |
---|---|
2372 break; | 2372 break; |
2373 | 2373 |
2374 default: | 2374 default: |
2375 if (cstack->cs_flags[idx] & CSF_FINALLY) | 2375 if (cstack->cs_flags[idx] & CSF_FINALLY) |
2376 { | 2376 { |
2377 if (cstack->cs_pending[idx] & CSTP_THROW) | 2377 if ((cstack->cs_pending[idx] & CSTP_THROW) |
2378 && cstack->cs_exception[idx] != NULL) | |
2378 { | 2379 { |
2379 // Cancel the pending exception. This is in the | 2380 // Cancel the pending exception. This is in the |
2380 // finally clause, so that the stack of the | 2381 // finally clause, so that the stack of the |
2381 // caught exceptions is not involved. | 2382 // caught exceptions is not involved. |
2382 discard_exception( | 2383 discard_exception( |