diff src/vim9.h @ 23994:3daeb2060f25 v8.2.2539

patch 8.2.2539: Vim9: return from finally block causes a hang Commit: https://github.com/vim/vim/commit/7e82c5f338efe5661951675565f27f6512901a6e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 21 21:32:45 2021 +0100 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 https://github.com/vim/vim/issues/7885)
author Bram Moolenaar <Bram@vim.org>
date Sun, 21 Feb 2021 21:45:03 +0100
parents 9fcd71d0db89
children 40e27d96e395
line wrap: on
line diff
--- a/src/vim9.h
+++ b/src/vim9.h
@@ -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