Mercurial > vim
comparison src/ex_eval.c @ 33636:53416c49a7ab v9.0.2059
patch 9.0.2059: outstanding exceptions may be skipped
Commit: https://github.com/vim/vim/commit/0ab500dede4edd8d5aee7ddc63444537be527871
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sat Oct 21 11:59:42 2023 +0200
patch 9.0.2059: outstanding exceptions may be skipped
Problem: outstanding exceptions may be skipped
Solution: When restoring exception state, process remaining outstanding
exceptions
closes: #13386
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 21 Oct 2023 12:15:03 +0200 |
parents | 31fb1a760ad6 |
children |
comparison
equal
deleted
inserted
replaced
33635:646844fb7fe0 | 33636:53416c49a7ab |
---|---|
755 { | 755 { |
756 estate->estate_current_exception = current_exception; | 756 estate->estate_current_exception = current_exception; |
757 estate->estate_did_throw = did_throw; | 757 estate->estate_did_throw = did_throw; |
758 estate->estate_need_rethrow = need_rethrow; | 758 estate->estate_need_rethrow = need_rethrow; |
759 estate->estate_trylevel = trylevel; | 759 estate->estate_trylevel = trylevel; |
760 estate->estate_did_emsg = did_emsg; | |
760 } | 761 } |
761 | 762 |
762 /* | 763 /* |
763 * Restore the current exception state from "estate" | 764 * Restore the current exception state from "estate" |
764 */ | 765 */ |
765 void | 766 void |
766 exception_state_restore(exception_state_T *estate) | 767 exception_state_restore(exception_state_T *estate) |
767 { | 768 { |
768 if (current_exception == NULL) | 769 // Handle any outstanding exceptions before restoring the state |
769 current_exception = estate->estate_current_exception; | 770 if (did_throw) |
770 did_throw |= estate->estate_did_throw; | 771 handle_did_throw(); |
771 need_rethrow |= estate->estate_need_rethrow; | 772 current_exception = estate->estate_current_exception; |
772 trylevel |= estate->estate_trylevel; | 773 did_throw = estate->estate_did_throw; |
774 need_rethrow = estate->estate_need_rethrow; | |
775 trylevel = estate->estate_trylevel; | |
776 did_emsg = estate->estate_did_emsg; | |
773 } | 777 } |
774 | 778 |
775 /* | 779 /* |
776 * Clear the current exception state | 780 * Clear the current exception state |
777 */ | 781 */ |
780 { | 784 { |
781 current_exception = NULL; | 785 current_exception = NULL; |
782 did_throw = FALSE; | 786 did_throw = FALSE; |
783 need_rethrow = FALSE; | 787 need_rethrow = FALSE; |
784 trylevel = 0; | 788 trylevel = 0; |
789 did_emsg = 0; | |
785 } | 790 } |
786 | 791 |
787 /* | 792 /* |
788 * Flags specifying the message displayed by report_pending. | 793 * Flags specifying the message displayed by report_pending. |
789 */ | 794 */ |