diff options
| author | Bram Moolenaar <Bram@vim.org> | 2021-12-26 14:23:22 +0000 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2021-12-26 14:23:22 +0000 |
| commit | 9c23f9bb5fe435b28245ba8ac65aa0ca6b902c04 (patch) | |
| tree | 1e2011970b07e6d2e0161e134c33b94e7a940e7e /src/testdir/test_vim9_func.vim | |
| parent | 71eb3ad5790ef3d16369e2fceb040980d75539cf (diff) | |
| download | vim-git-8.2.3902.tar.gz | |
patch 8.2.3902: Vim9: double free with nested :def functionv8.2.3902
Problem: Vim9: double free with nested :def function.
Solution: Pass "line_to_free" from compile_def_function() and make sure
cmdlinep is valid.
Diffstat (limited to 'src/testdir/test_vim9_func.vim')
| -rw-r--r-- | src/testdir/test_vim9_func.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 5b8ad17c7..1a14c1016 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1669,6 +1669,26 @@ def Test_error_in_nested_function() assert_fails('FuncWithForwardCall()', 'E1096:', '', 1, 'FuncWithForwardCall') enddef +def Test_nested_functin_with_nextcmd() + var lines =<< trim END + vim9script + # Define an outer function + def FirstFunction() + # Define an inner function + def SecondFunction() + # the function has a body, a double free is detected. + AAAAA + + # enddef followed by | or } followed by # one or more characters + enddef|BBBB + enddef + + # Compile all functions + defcompile + END + CheckScriptFailure(lines, 'E476: Invalid command: AAAAA') +enddef + def Test_return_type_wrong() CheckScriptFailure([ 'def Func(): number', |
