vim-patch:8.2.4397: crash when using many composing characters in error message (#23481)

Problem:    Crash when using many composing characters in error message.
Solution:   Use mb_cptr2char_adv() instead of mb_ptr2char_adv().

34f8117dec

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-05-05 06:22:37 +08:00
committed by GitHub
parent f6299e9d6e
commit d79e726212
2 changed files with 9 additions and 1 deletions

View File

@@ -53,6 +53,14 @@ func Test_assert_equal()
call assert_equal("\b\e\f\n\t\r\\\x01\x7f", 'x')
call assert_match('Expected ''\\b\\e\\f\\n\\t\\r\\\\\\x01\\x7f'' but got ''x''', v:errors[0])
call remove(v:errors, 0)
" many composing characters are handled properly
call setline(1, ' ')
norm 100gr݀
call assert_equal(1, getline(1))
call assert_match("Expected 1 but got '.* occurs 100 times]'", v:errors[0])
call remove(v:errors, 0)
bwipe!
endfunc
func Test_assert_equal_dict()