Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
23993:fa875fec0ed5 | 23994:3daeb2060f25 |
---|---|
98 | 98 |
99 ISN_TRY, // add entry to ec_trystack, uses isn_arg.try | 99 ISN_TRY, // add entry to ec_trystack, uses isn_arg.try |
100 ISN_THROW, // pop value of stack, store in v:exception | 100 ISN_THROW, // pop value of stack, store in v:exception |
101 ISN_PUSHEXC, // push v:exception | 101 ISN_PUSHEXC, // push v:exception |
102 ISN_CATCH, // drop v:exception | 102 ISN_CATCH, // drop v:exception |
103 ISN_FINALLY, // start of :finally block | |
103 ISN_ENDTRY, // take entry off from ec_trystack | 104 ISN_ENDTRY, // take entry off from ec_trystack |
104 ISN_TRYCONT, // handle :continue inside a :try statement | 105 ISN_TRYCONT, // handle :continue inside a :try statement |
105 | 106 |
106 // more expression operations | 107 // more expression operations |
107 ISN_ADDLIST, // add two lists | 108 ISN_ADDLIST, // add two lists |
206 typedef struct { | 207 typedef struct { |
207 int for_idx; // loop variable index | 208 int for_idx; // loop variable index |
208 int for_end; // position to jump to after done | 209 int for_end; // position to jump to after done |
209 } forloop_T; | 210 } forloop_T; |
210 | 211 |
211 // arguments to ISN_TRY | 212 // indirect arguments to ISN_TRY |
212 typedef struct { | 213 typedef struct { |
213 int try_catch; // position to jump to on throw | 214 int try_catch; // position to jump to on throw |
214 int try_finally; // :finally or :endtry position to jump to | 215 int try_finally; // :finally or :endtry position to jump to |
216 int try_endtry; // :endtry position to jump to | |
217 } tryref_T; | |
218 | |
219 // arguments to ISN_TRY | |
220 typedef struct { | |
221 tryref_T *try_ref; | |
215 } try_T; | 222 } try_T; |
216 | 223 |
217 // arguments to ISN_TRYCONT | 224 // arguments to ISN_TRYCONT |
218 typedef struct { | 225 typedef struct { |
219 int tct_levels; // number of nested try statements | 226 int tct_levels; // number of nested try statements |