1
0
forked from aniani/vim

patch 8.2.2539: Vim9: return from finally block causes a hang

Problem:    Vim9: return from finally block causes a hang.
Solution:   Store both the finally and endtry indexes. (closes #7885)
This commit is contained in:
Bram Moolenaar
2021-02-21 21:32:45 +01:00
parent 21578271bb
commit 7e82c5f338
6 changed files with 89 additions and 38 deletions

View File

@@ -100,6 +100,7 @@ typedef enum {
ISN_THROW, // pop value of stack, store in v:exception
ISN_PUSHEXC, // push v:exception
ISN_CATCH, // drop v:exception
ISN_FINALLY, // start of :finally block
ISN_ENDTRY, // take entry off from ec_trystack
ISN_TRYCONT, // handle :continue inside a :try statement
@@ -208,10 +209,16 @@ typedef struct {
int for_end; // position to jump to after done
} forloop_T;
// arguments to ISN_TRY
// indirect arguments to ISN_TRY
typedef struct {
int try_catch; // position to jump to on throw
int try_finally; // :finally or :endtry position to jump to
int try_endtry; // :endtry position to jump to
} tryref_T;
// arguments to ISN_TRY
typedef struct {
tryref_T *try_ref;
} try_T;
// arguments to ISN_TRYCONT