Mercurial > vim
comparison src/testdir/test_startup.vim @ 25885:7c640ad754fb v8.2.3476
patch 8.2.3476: renaming a buffer on startup may cause using freed memory
Commit: https://github.com/vim/vim/commit/d3710cf01ef6ab1b2f233866ff01dab76686f642
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 4 23:13:13 2021 +0100
patch 8.2.3476: renaming a buffer on startup may cause using freed memory
Problem: Renaming a buffer on startup may cause using freed memory.
Solution: Check if the buffer is used in a window. (closes https://github.com/vim/vim/issues/8955)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 05 Oct 2021 00:15:04 +0200 |
parents | 7dbd3a65a04b |
children | 86b63591bed2 |
comparison
equal
deleted
inserted
replaced
25884:25fbd356bb09 | 25885:7c640ad754fb |
---|---|
1294 endif | 1294 endif |
1295 call delete('Xscript') | 1295 call delete('Xscript') |
1296 call delete('Xresult') | 1296 call delete('Xresult') |
1297 endfunc | 1297 endfunc |
1298 | 1298 |
1299 func Test_rename_buffer_on_startup() | |
1300 let lines =<< trim END | |
1301 call writefile(['done'], 'Xresult') | |
1302 qa! | |
1303 END | |
1304 call writefile(lines, 'Xscript') | |
1305 if RunVim([], [], "--clean -e -s --cmd 'file x|new|file x' --cmd 'so Xscript'") | |
1306 call assert_equal(['done'], readfile('Xresult')) | |
1307 endif | |
1308 call delete('Xscript') | |
1309 call delete('Xresult') | |
1310 endfunc | |
1311 | |
1312 | |
1299 " vim: shiftwidth=2 sts=2 expandtab | 1313 " vim: shiftwidth=2 sts=2 expandtab |