aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_eval.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-01-21 03:27:48 +0300
committerZyX <kp-pav@yandex.ru>2018-03-25 14:50:48 +0300
commit79b4b6fc86497fcb7b3f986e98cbf03f93b5b082 (patch)
tree2fcdd5af2b8bf6b05ddab5eb87fcf344ddbda5a2 /src/nvim/ex_eval.c
parentf8d2aef4f20887bb5a407b5a34cd5dc29fc6771c (diff)
downloadrneovim-79b4b6fc86497fcb7b3f986e98cbf03f93b5b082.tar.gz
rneovim-79b4b6fc86497fcb7b3f986e98cbf03f93b5b082.tar.bz2
rneovim-79b4b6fc86497fcb7b3f986e98cbf03f93b5b082.zip
*: Make sure that !did_throw implies !current_exception
Fixes #7876
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r--src/nvim/ex_eval.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c
index 4010a088c8..ef287fe34d 100644
--- a/src/nvim/ex_eval.c
+++ b/src/nvim/ex_eval.c
@@ -1426,6 +1426,10 @@ void ex_catch(exarg_T *eap)
if (cstack->cs_exception[cstack->cs_idx] != current_exception) {
internal_error("ex_catch()");
}
+ // Discarding current_exceptions happens based on what is stored in
+ // cstack->cs_exception, *all* calls to discard_current_exception() are
+ // (and must be) guarded by did_throw which was already unset above.
+ current_exception = NULL;
} else {
/*
* If there is a preceding catch clause and it caught the exception,
@@ -1785,7 +1789,8 @@ void enter_cleanup(cleanup_T *csp)
cause_abort = FALSE;
}
}
- did_emsg = got_int = did_throw = need_rethrow = FALSE;
+ did_emsg = got_int = did_throw = need_rethrow = false;
+ current_exception = NULL;
/* Report if required by the 'verbose' option or when debugging. */
report_make_pending(pending, csp->exception);