diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-05-09 17:09:30 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-05-09 17:09:30 +0100 |
commit | d1ae8366aff286d41e7f5bc513cc0a1af5130aad (patch) | |
tree | c0b474e5d0767d6d4229090577c3a8cc92ecf0e1 /src/testdir/test_registers.vim | |
parent | aa6ba308a1498dc8da04d1d30ec0470018bf782a (diff) |
patch 9.0.1531: crash when register contents ends up being invalidv9.0.1531
Problem: Crash when register contents ends up being invalid.
Solution: Check "y_array" is not NULL.
Diffstat (limited to 'src/testdir/test_registers.vim')
-rw-r--r-- | src/testdir/test_registers.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim index e966932478..33ea0f4bd3 100644 --- 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() |