diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-02-27 22:06:51 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-27 22:06:51 +0000 |
commit | 3f45d67a150f934ab819c3739cf189a0e2c9545c (patch) | |
tree | 6a221a2ff0bf1f90f48d7592b401a8217a95df5b /src/testdir | |
parent | 99ad3a8bb95c6f860545a050472b6181e33bac1a (diff) |
patch 9.0.1363: crash when :def function has :break in skipped blockv9.0.1363
Problem: Crash when :def function has :break in skipped block. (Ernie Rael)
Solution: Don't generate a jump for a skipped :break. (closes #12077)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_func.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index f9ff3bc3e6..0f28ba038f 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -166,6 +166,31 @@ def Test_wrong_function_name() delfunc g:Define enddef +def Test_break_in_skipped_block() + var lines =<< trim END + vim9script + + def FixStackFrame(): string + for _ in [2] + var path = 'xxx' + if !!path + if false + break + else + return 'foo' + endif + endif + endfor + return 'xxx' + enddef + + disas FixStackFrame + + FixStackFrame() + END + v9.CheckScriptSuccess(lines) +enddef + def Test_autoload_name_mismatch() var dir = 'Xnamedir/autoload' mkdir(dir, 'pR') |