summaryrefslogtreecommitdiffstats
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-30 20:39:15 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-30 20:39:15 +0200
commit834193afd7195bc96026d2aed696d64f8075cd35 (patch)
treec1e71ec5daddb8b3406fb2d3e7bc91965231c7c6 /src/vim9compile.c
parentd3d8feeb897a6b956fc82c81448b938a53312d71 (diff)
patch 8.2.3078: Vim9: profile test failsv8.2.3078
Problem: Vim9: profile test fails. Solution: Make throw in :catch jump to :finally.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index e3e1721f13..533c0b33eb 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -8397,10 +8397,17 @@ compile_finally(char_u *arg, cctx_T *cctx)
this_instr = instr->ga_len;
#ifdef FEAT_PROFILE
if (cctx->ctx_compile_type == CT_PROFILE
- && ((isn_T *)instr->ga_data)[instr->ga_len - 1]
+ && ((isn_T *)instr->ga_data)[this_instr - 1]
.isn_type == ISN_PROF_START)
+ {
// jump to the profile start of the "finally"
--this_instr;
+
+ // jump to the profile end above it
+ if (this_instr > 0 && ((isn_T *)instr->ga_data)[this_instr - 1]
+ .isn_type == ISN_PROF_END)
+ --this_instr;
+ }
#endif
// Fill in the "end" label in jumps at the end of the blocks.