0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.1282: Vim9: crash when using CheckScriptFailure()

Problem:    Vim9: crash when using CheckScriptFailure() in
            Test_vim9script_call_fail_decl().
Solution:   Do not decrement the def_functions len unless the function was
            newly added.
This commit is contained in:
Bram Moolenaar
2020-07-23 18:26:30 +02:00
parent 2d06bfde29
commit 6c4bfe4b31
3 changed files with 17 additions and 8 deletions

View File

@@ -258,7 +258,7 @@ endfunc
def Test_call_funcref()
assert_equal(3, g:SomeFunc('abc'))
assert_fails('NotAFunc()', 'E117:')
assert_fails('NotAFunc()', 'E117:') # comment after call
assert_fails('g:NotAFunc()', 'E117:')
let lines =<< trim END
@@ -425,9 +425,7 @@ def Test_vim9script_call_fail_decl()
enddef
defcompile
END
writefile(lines, 'Xcall_decl.vim')
assert_fails('source Xcall_decl.vim', 'E1054:')
delete('Xcall_decl.vim')
CheckScriptFailure(lines, 'E1054:')
enddef
def Test_vim9script_call_fail_type()