1
0
forked from aniani/vim

patch 8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level

Problem:    Vim9: exception in ISN_INSTR caught at wrong level.
Solution:   Set the starting trylevel in exec_instructions(). (closes #8214)
This commit is contained in:
Bram Moolenaar
2021-05-16 15:24:49 +02:00
parent 3ec3217f04
commit ff65288aa8
5 changed files with 23 additions and 4 deletions

View File

@@ -1295,6 +1295,9 @@ exec_instructions(ectx_T *ectx)
// Start execution at the first instruction.
ectx->ec_iidx = 0;
// Only catch exceptions in this instruction list.
ectx->ec_trylevel_at_start = trylevel;
for (;;)
{
isn_T *iptr;
@@ -4158,7 +4161,6 @@ call_def_function(
ga_init2(&ectx.ec_trystack, sizeof(trycmd_T), 10);
ga_init2(&ectx.ec_funcrefs, sizeof(partial_T *), 10);
ectx.ec_did_emsg_before = did_emsg_before;
ectx.ec_trylevel_at_start = trylevel;
idx = argc - ufunc->uf_args.ga_len;
if (idx > 0 && ufunc->uf_va_name == NULL)