0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 9.0.0101: invalid memory access in diff mode with "dp" and undo

Problem:    Invalid memory access in diff mode with "dp" and undo.
Solution:   Make sure the line number does not go below one.
This commit is contained in:
Bram Moolenaar
2022-07-28 18:44:27 +01:00
parent cb5ed4d625
commit 4e677b9c40
3 changed files with 22 additions and 3 deletions

View File

@@ -1628,5 +1628,19 @@ func Test_diff_manipulations()
doobdeu
set nodiff
%bwipe!
endfunc
" This was causing the line number in the diff block to go below one.
" FIXME: somehow this causes a valgrind error when run directly but not when
" run as a test.
func Test_diff_put_and_undo()
set diff
next 0
split 00
sil! norm o0gguudpo0ggJuudp
bwipe!
bwipe!
set nodiff
endfunc