0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

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

@@ -577,6 +577,16 @@ def Test_try_catch_throw()
counter += 1
endfor
assert_equal(4, counter)
# return in finally after empty catch
def ReturnInFinally(): number
try
finally
return 4
endtry
return 2
enddef
assert_equal(4, ReturnInFinally())
enddef
def Test_cnext_works_in_catch()