mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 18:11:47 +00:00
vim-patch:9.0.1511: crash when using wrong arg types to assert_match() (#23507)
Problem: Crash when using wrong arg types to assert_match().
Solution: Check for NULL pointer. (closes vim/vim#12349)
12e7a1fe75
This commit is contained in:
@@ -324,6 +324,23 @@ func Test_assert_fail_fails()
|
||||
call remove(v:errors, 0)
|
||||
endfunc
|
||||
|
||||
func Test_assert_wrong_arg_emsg_off()
|
||||
CheckFeature folding
|
||||
|
||||
new
|
||||
call setline(1, ['foo', 'bar'])
|
||||
1,2fold
|
||||
|
||||
" This used to crash Vim
|
||||
let &l:foldtext = 'assert_match({}, {})'
|
||||
redraw!
|
||||
|
||||
let &l:foldtext = 'assert_equalfile({}, {})'
|
||||
redraw!
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_assert_fails_in_try_block()
|
||||
try
|
||||
call assert_equal(0, assert_fails('throw "error"'))
|
||||
|
||||
Reference in New Issue
Block a user