1
0
forked from aniani/vim

patch 8.2.4622: Vim9: crash with :execute and :finish

Problem:    Vim9: Crash with :execute and :finish. (Sergey Vlasov)
Solution:   Check for NULL. (closes #10011)
This commit is contained in:
Bram Moolenaar
2022-03-25 11:16:28 +00:00
parent 9dd42a6311
commit 43216611a5
3 changed files with 25 additions and 1 deletions

View File

@@ -1830,6 +1830,24 @@ def Test_execute_cmd_vimscript()
v9.CheckScriptSuccess(lines)
enddef
def Test_execute_finish()
# the empty lines are relevant here
var lines =<< trim END
vim9script
var vname = "g:hello"
if exists(vname) | finish | endif | execute vname '= "world"'
assert_equal('world', g:hello)
if exists(vname) | finish | endif | execute vname '= "world"'
assert_report('should not be reached')
END
v9.CheckScriptSuccess(lines)
enddef
def Test_echo_cmd()
echo 'some' # comment
echon 'thing'