Mercurial > vim
diff src/testdir/test_registers.vim @ 32399:18dd2b5d008c v9.0.1531
patch 9.0.1531: crash when register contents ends up being invalid
Commit: https://github.com/vim/vim/commit/d1ae8366aff286d41e7f5bc513cc0a1af5130aad
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 9 17:09:30 2023 +0100
patch 9.0.1531: crash when register contents ends up being invalid
Problem: Crash when register contents ends up being invalid.
Solution: Check "y_array" is not NULL.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 09 May 2023 18:15:03 +0200 |
parents | 83b25278bac3 |
children | 66c70cf4387c |
line wrap: on
line diff
--- a/src/testdir/test_registers.vim +++ b/src/testdir/test_registers.vim @@ -835,6 +835,23 @@ func Test_end_reg_executing() bwipe! endfunc +" This was causing a crash because y_append was ending up being NULL +func Test_zero_y_append() + " Run in a separate Vim instance because changing 'encoding' may cause + " trouble for later tests. + let lines =<< trim END + d + silent ?n + next <sfile> + so + sil! norm 0VPSP + set enc=latin1 + + END + call writefile(lines, 'XTest_zero_y_append', 'D') + call RunVim([], [], '-u NONE -i NONE -e -s -S XTest_zero_y_append -c qa\!') +endfunc + " Make sure that y_append is correctly reset " and the previous register is working as expected func Test_register_y_append_reset()