Mercurial > vim
diff src/testdir/test_autocmd.vim @ 23843:d97258eca25d v8.2.2463
patch 8.2.2463: using :arglocal in an autocommand may use freed memory
Commit: https://github.com/vim/vim/commit/6bcb877ec19a647443195a54eeac60cb693fd827
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 3 21:23:29 2021 +0100
patch 8.2.2463: using :arglocal in an autocommand may use freed memory
Problem: Using :arglocal in an autocommand may use freed memory.
(houyunsong)
Solution: Check if the arglist is locked.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 03 Feb 2021 21:30:04 +0100 |
parents | bb2afcad503b |
children | 7517eb94239b |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -2717,4 +2717,13 @@ func Test_close_autocmd_tab() %bwipe! endfunc +" This was using freed memory. +func Test_BufNew_arglocal() + arglocal + au BufNew * arglocal + call assert_fails('drop xx', 'E1156:') + + au! BufNew +endfunc + " vim: shiftwidth=2 sts=2 expandtab