Skip to content

Commit

Permalink
patch 8.2.3728: internal error when passing range() to list2blob()
Browse files Browse the repository at this point in the history
Problem:    Internal error when passing range() to list2blob().
Solution:   Materialize the list first. (closes #9262)
  • Loading branch information
kuuote authored and brammool committed Dec 3, 2021
1 parent c14b57c commit 04b7b4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/blob.c
Expand Up @@ -526,6 +526,7 @@ f_list2blob(typval_T *argvars, typval_T *rettv)
if (l == NULL)
return;

CHECK_LIST_MATERIALIZE(l);
FOR_ALL_LIST_ITEMS(l, li)
{
int error;
Expand Down
3 changes: 3 additions & 0 deletions src/testdir/test_blob.vim
Expand Up @@ -675,7 +675,10 @@ func Test_list2blob()
let b = range(16)->repeat(64)->list2blob()
call assert_equal(1024, b->len())
call assert_equal([4, 8, 15], [b[100], b[1000], b[1023]])

call assert_equal(0z, list2blob(test_null_list()))
call assert_equal(0z00010203, list2blob(range(4)))
endfunc


" vim: shiftwidth=2 sts=2 expandtab
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -753,6 +753,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3728,
/**/
3727,
/**/
Expand Down

0 comments on commit 04b7b4b

Please sign in to comment.