comparison 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
comparison
equal deleted inserted replaced
32398:0c8925ba7971 32399:18dd2b5d008c
831 call assert_equal('', @a) 831 call assert_equal('', @a)
832 call assert_equal('aaa', getline(1)) 832 call assert_equal('aaa', getline(1))
833 833
834 nunmap s 834 nunmap s
835 bwipe! 835 bwipe!
836 endfunc
837
838 " This was causing a crash because y_append was ending up being NULL
839 func Test_zero_y_append()
840 " Run in a separate Vim instance because changing 'encoding' may cause
841 " trouble for later tests.
842 let lines =<< trim END
843 d
844 silent ?n
845 next <sfile>
846 so
847 sil! norm 0V€PSP
848 set enc=latin1
849  
850 END
851 call writefile(lines, 'XTest_zero_y_append', 'D')
852 call RunVim([], [], '-u NONE -i NONE -e -s -S XTest_zero_y_append -c qa\!')
836 endfunc 853 endfunc
837 854
838 " Make sure that y_append is correctly reset 855 " Make sure that y_append is correctly reset
839 " and the previous register is working as expected 856 " and the previous register is working as expected
840 func Test_register_y_append_reset() 857 func Test_register_y_append_reset()