1
0
forked from aniani/vim

patch 8.2.2095: Vim9: crash when failed dict member is followed by concat

Problem:    Vim9: crash when failed dict member is followed by concatenation.
Solution:   Remove the dict from the stack. (closes #7416)
This commit is contained in:
Bram Moolenaar
2020-12-05 18:13:27 +01:00
parent d0fe620cbb
commit 4029cabbe7
3 changed files with 30 additions and 0 deletions

View File

@@ -1794,6 +1794,25 @@ def Test_abort_even_with_silent()
enddef
sil! Func()
assert_equal('none', g:result)
unlet g:result
END
CheckScriptSuccess(lines)
enddef
def Test_dict_member_with_silent()
var lines =<< trim END
vim9script
g:result = 'none'
var d: dict<any>
def Func()
try
g:result = map([], {_, v -> {}[v]})->join() .. d['']
catch
endtry
enddef
silent! Func()
assert_equal('0', g:result)
unlet g:result
END
CheckScriptSuccess(lines)
enddef