forked from aniani/vim
patch 8.2.4762: using freed memory using synstack() and synID() in WinEnter
Problem: Using freed memory when using synstack() and synID() in WinEnter. Solution: Check using the syntax window. (closes #10204)
This commit is contained in:
@@ -956,5 +956,18 @@ func Test_syn_include_contains_TOP()
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
" This was using freed memory
|
||||
func Test_WinEnter_synstack_synID()
|
||||
autocmd WinEnter * call synstack(line("."), col("."))
|
||||
autocmd WinEnter * call synID(line('.'), col('.') - 1, 1)
|
||||
call setline(1, 'aaaaa')
|
||||
normal! $
|
||||
new
|
||||
close
|
||||
|
||||
au! WinEnter
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user