diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-02-03 21:23:29 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-02-03 21:23:29 +0100 |
commit | 6bcb877ec19a647443195a54eeac60cb693fd827 (patch) | |
tree | 03771c400bda7fb02e8466d0a3f3a281d61a35a0 /src/testdir/test_autocmd.vim | |
parent | 2c363a2e95ee0b366e72063d093d20e025ef4a66 (diff) |
patch 8.2.2463: using :arglocal in an autocommand may use freed memoryv8.2.2463
Problem: Using :arglocal in an autocommand may use freed memory.
(houyunsong)
Solution: Check if the arglist is locked.
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index dab699155c..71f8d2d60c 100644 --- 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 |