diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-16 19:34:44 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-16 19:34:44 +0100 |
commit | 1889f499a4f248cd84e0e0bf6d0d820016774494 (patch) | |
tree | c96c3f34bca0a083d283707c86aa2a808a4dcd47 /src/testdir | |
parent | f6d39c31d2177549a986d170e192d8351bd571e2 (diff) | |
download | vim-git-1889f499a4f248cd84e0e0bf6d0d820016774494.tar.gz |
patch 9.0.0221: accessing freed memory if compiling nested function failsv9.0.0221
Problem: Accessing freed memory if compiling nested function fails.
Solution: Mess up the variable name so that it won't be found.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_func.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 5c7545784..fd7182d50 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -911,6 +911,18 @@ def Test_nested_function() v9.CheckScriptFailure(lines, 'E1173: Text found after enddef: burp', 3) enddef +def Test_nested_function_fails() + var lines =<< trim END + def T() + def Func(g: string):string + enddef + Func() + enddef + silent! defcompile + END + v9.CheckScriptFailure(lines, 'E1069:') +enddef + def Test_not_nested_function() echo printf('%d', function('len')('xxx')) |