mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
Merge pull request #29945 from zeertzjq/vim-9.1.0647
vim-patch:9.0.{2149,2158},9.1.0647
This commit is contained in:
commit
ac15db4b9c
@ -73,6 +73,7 @@
|
|||||||
#include "nvim/statusline.h"
|
#include "nvim/statusline.h"
|
||||||
#include "nvim/strings.h"
|
#include "nvim/strings.h"
|
||||||
#include "nvim/syntax.h"
|
#include "nvim/syntax.h"
|
||||||
|
#include "nvim/tag.h"
|
||||||
#include "nvim/terminal.h"
|
#include "nvim/terminal.h"
|
||||||
#include "nvim/types_defs.h"
|
#include "nvim/types_defs.h"
|
||||||
#include "nvim/ui.h"
|
#include "nvim/ui.h"
|
||||||
@ -5205,8 +5206,7 @@ void win_free(win_T *wp, tabpage_T *tp)
|
|||||||
xfree(wp->w_lines);
|
xfree(wp->w_lines);
|
||||||
|
|
||||||
for (int i = 0; i < wp->w_tagstacklen; i++) {
|
for (int i = 0; i < wp->w_tagstacklen; i++) {
|
||||||
xfree(wp->w_tagstack[i].tagname);
|
tagstack_clear_entry(&wp->w_tagstack[i]);
|
||||||
xfree(wp->w_tagstack[i].user_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree(wp->w_localdir);
|
xfree(wp->w_localdir);
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
|
local t = require('test.testutil')
|
||||||
local n = require('test.functional.testnvim')()
|
local n = require('test.functional.testnvim')()
|
||||||
|
|
||||||
local assert_alive = n.assert_alive
|
local assert_alive = n.assert_alive
|
||||||
local clear = n.clear
|
local clear = n.clear
|
||||||
local command = n.command
|
local command = n.command
|
||||||
|
local eq = t.eq
|
||||||
|
local eval = n.eval
|
||||||
|
local exec = n.exec
|
||||||
local feed = n.feed
|
local feed = n.feed
|
||||||
|
|
||||||
before_each(clear)
|
before_each(clear)
|
||||||
@ -32,3 +36,18 @@ it('no crash with very long option error message', function()
|
|||||||
pcall(command, 'source test/old/testdir/crash/poc_did_set_langmap')
|
pcall(command, 'source test/old/testdir/crash/poc_did_set_langmap')
|
||||||
assert_alive()
|
assert_alive()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('no crash when closing window with tag in loclist', function()
|
||||||
|
exec([[
|
||||||
|
new
|
||||||
|
lexpr ['foo']
|
||||||
|
lopen
|
||||||
|
let g:qf_bufnr = bufnr()
|
||||||
|
lclose
|
||||||
|
call settagstack(1, #{items: [#{tagname: 'foo', from: [g:qf_bufnr, 1, 1, 0]}]})
|
||||||
|
]])
|
||||||
|
eq(1, eval('bufexists(g:qf_bufnr)'))
|
||||||
|
command('1close')
|
||||||
|
eq(0, eval('bufexists(g:qf_bufnr)'))
|
||||||
|
assert_alive()
|
||||||
|
end)
|
||||||
|
BIN
test/old/testdir/crash/double_free
Normal file
BIN
test/old/testdir/crash/double_free
Normal file
Binary file not shown.
BIN
test/old/testdir/crash/poc_uaf_check_argument_types
Normal file
BIN
test/old/testdir/crash/poc_uaf_check_argument_types
Normal file
Binary file not shown.
BIN
test/old/testdir/crash/poc_uaf_exec_instructions
Normal file
BIN
test/old/testdir/crash/poc_uaf_exec_instructions
Normal file
Binary file not shown.
@ -113,6 +113,7 @@ endfunc
|
|||||||
func Test_crash1_2()
|
func Test_crash1_2()
|
||||||
CheckNotBSD
|
CheckNotBSD
|
||||||
CheckExecutable dash
|
CheckExecutable dash
|
||||||
|
let g:test_is_flaky = 1
|
||||||
|
|
||||||
" The following used to crash Vim
|
" The following used to crash Vim
|
||||||
let opts = #{cmd: 'sh'}
|
let opts = #{cmd: 'sh'}
|
||||||
@ -149,22 +150,9 @@ func Test_crash1_2()
|
|||||||
\ ' ; echo "crash 4: [OK]" >> '.. result .. "\<cr>")
|
\ ' ; echo "crash 4: [OK]" >> '.. result .. "\<cr>")
|
||||||
call TermWait(buf, 150)
|
call TermWait(buf, 150)
|
||||||
|
|
||||||
let file = 'crash/poc_ex_substitute'
|
|
||||||
let cmn_args = "%s -u NONE -i NONE -n -e -s -S %s -c ':qa!'"
|
|
||||||
let args = printf(cmn_args, vim, file)
|
|
||||||
" just make sure it runs, we don't care about the resulting echo
|
|
||||||
call term_sendkeys(buf, args .. "\<cr>")
|
|
||||||
" There is no output generated in Github CI for the asan clang build.
|
|
||||||
" so just skip generating the ouput.
|
|
||||||
" call term_sendkeys(buf, args ..
|
|
||||||
" \ ' && echo "crash 5: [OK]" >> '.. result .. "\<cr>")
|
|
||||||
call TermWait(buf, 150)
|
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
exe buf .. "bw!"
|
exe buf .. "bw!"
|
||||||
|
|
||||||
exe "sp " .. result
|
exe "sp " .. result
|
||||||
|
|
||||||
let expected = [
|
let expected = [
|
||||||
\ 'crash 1: [OK]',
|
\ 'crash 1: [OK]',
|
||||||
\ 'crash 2: [OK]',
|
\ 'crash 2: [OK]',
|
||||||
@ -174,10 +162,45 @@ func Test_crash1_2()
|
|||||||
|
|
||||||
call assert_equal(expected, getline(1, '$'))
|
call assert_equal(expected, getline(1, '$'))
|
||||||
bw!
|
bw!
|
||||||
|
|
||||||
call delete(result)
|
call delete(result)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" This test just runs various scripts, that caused issues before.
|
||||||
|
" We are not really asserting anything here, it's just important
|
||||||
|
" that ASAN does not detect any issues.
|
||||||
|
func Test_crash1_3()
|
||||||
|
let vim = GetVimProg()
|
||||||
|
let buf = RunVimInTerminal('sh', #{cmd: 'sh'})
|
||||||
|
|
||||||
|
let file = 'crash/poc_ex_substitute'
|
||||||
|
let cmn_args = "%s -u NONE -i NONE -n -e -s -S %s -c ':qa!'\<cr>"
|
||||||
|
let args = printf(cmn_args, vim, file)
|
||||||
|
call term_sendkeys(buf, args)
|
||||||
|
call TermWait(buf, 150)
|
||||||
|
|
||||||
|
let file = 'crash/poc_uaf_exec_instructions'
|
||||||
|
let cmn_args = "%s -u NONE -i NONE -n -e -s -S %s -c ':qa!'\<cr>"
|
||||||
|
let args = printf(cmn_args, vim, file)
|
||||||
|
call term_sendkeys(buf, args)
|
||||||
|
call TermWait(buf, 150)
|
||||||
|
|
||||||
|
let file = 'crash/poc_uaf_check_argument_types'
|
||||||
|
let cmn_args = "%s -u NONE -i NONE -n -e -s -S %s -c ':qa!'\<cr>"
|
||||||
|
let args = printf(cmn_args, vim, file)
|
||||||
|
call term_sendkeys(buf, args)
|
||||||
|
call TermWait(buf, 150)
|
||||||
|
|
||||||
|
let file = 'crash/double_free'
|
||||||
|
let cmn_args = "%s -u NONE -i NONE -n -e -s -S %s -c ':qa!'\<cr>"
|
||||||
|
let args = printf(cmn_args, vim, file)
|
||||||
|
call term_sendkeys(buf, args)
|
||||||
|
call TermWait(buf, 50)
|
||||||
|
|
||||||
|
" clean up
|
||||||
|
exe buf .. "bw!"
|
||||||
|
bw!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_crash2()
|
func Test_crash2()
|
||||||
" The following used to crash Vim
|
" The following used to crash Vim
|
||||||
let opts = #{wait_for_ruler: 0, rows: 20}
|
let opts = #{wait_for_ruler: 0, rows: 20}
|
||||||
|
Loading…
Reference in New Issue
Block a user