From ce7bcdec239a723a2f696df8673cb73cbc31b477 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 5 Aug 2019 22:33:50 -0400 Subject: [PATCH 1/2] vim-patch:8.1.1465: allocating wrong amount of memory Problem: Allocating wrong amount of memory. (Yegappan Lakshmanan) Solution: Use sizeof() for right type of struct. https://github.com/vim/vim/commit/a37833dbd7d3cb0fff4cbf0ba6e80d0ad55cd4b9 --- src/nvim/testdir/samples/memfile_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/testdir/samples/memfile_test.c b/src/nvim/testdir/samples/memfile_test.c index 3c8f108255..c71a5c8f40 100644 --- a/src/nvim/testdir/samples/memfile_test.c +++ b/src/nvim/testdir/samples/memfile_test.c @@ -70,7 +70,7 @@ test_mf_hash(void) assert(mf_hash_find(&ht, key) == NULL); /* allocate and add new item */ - item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE); + item = (mf_hashitem_T *)lalloc_clear(sizeof(*item), FALSE); assert(item != NULL); item->mhi_key = key; mf_hash_add_item(&ht, item); From 11a6dac8c935a530c18fd1c7488c358f43b80ff5 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 5 Aug 2019 22:41:02 -0400 Subject: [PATCH 2/2] vim-patch:8.1.1467: cscope test fails Problem: Cscope test fails. Solution: Update expected text. https://github.com/vim/vim/commit/d6ec1730bab0ef4a472637ffe5796d1351442308 --- src/nvim/testdir/test_cscope.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/testdir/test_cscope.vim b/src/nvim/testdir/test_cscope.vim index 067fd85819..e5dab05511 100644 --- a/src/nvim/testdir/test_cscope.vim +++ b/src/nvim/testdir/test_cscope.vim @@ -123,8 +123,8 @@ func Test_cscopeWithCscopeConnections() if cs_version >= 15.8 for cmd in ['cs find a item', 'cs find 9 item'] let a = execute(cmd) - call assert_equal(['', '(1 of 4): <> item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);'], split(a, '\n', 1)) - call assert_equal(' item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);', getline('.')) + call assert_equal(['', '(1 of 4): <> item = (mf_hashitem_T *)lalloc_clear(sizeof(*item), FALSE);'], split(a, '\n', 1)) + call assert_equal(' item = (mf_hashitem_T *)lalloc_clear(sizeof(*item), FALSE);', getline('.')) cnext call assert_equal(' item = mf_hash_find(&ht, key);', getline('.')) cnext