]> granicus.if.org Git - vim/commitdiff
patch 8.2.3728: internal error when passing range() to list2blob() v8.2.3728
authorkuuote <znmxodq1@gmail.com>
Fri, 3 Dec 2021 13:57:00 +0000 (13:57 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 3 Dec 2021 13:57:00 +0000 (13:57 +0000)
Problem:    Internal error when passing range() to list2blob().
Solution:   Materialize the list first. (closes #9262)

src/blob.c
src/testdir/test_blob.vim
src/version.c

index 04319f8b1ed6cfb11e6cb8f2436623cfb670bb03..2833c1a8c6804c8b9e52bbe35fe46f151a42c49c 100644 (file)
@@ -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;
index 473886d68e087e31737185e6b42866102912a85a..bd816af4a509a4cfcea978b986d62b91099d3892 100644 (file)
@@ -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
index 184b3772a0312b321c72be609a938d259e22ba9f..0aadf4b4965c5f7e34c3d6e49eb925f0e3ee7304 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3728,
 /**/
     3727,
 /**/