[vim/vim] Add the blob2list() and list2blob() functions (#8868)

10 views
Skip to first unread message

Yegappan Lakshmanan

unread,
Sep 12, 2021, 4:31:59 PM9/12/21
to vim/vim, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/8868

Commit Summary

  • Add the blob2list() and list2blob() functions

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

codecov[bot]

unread,
Sep 12, 2021, 4:34:40 PM9/12/21
to vim/vim, Subscribed

Codecov Report

Merging #8868 (8da2229) into master (28e591d) will decrease coverage by 87.72%.
The diff coverage is 0.00%.

Current head 8da2229 differs from pull request most recent head 4c30b24. Consider uploading reports for the commit 4c30b24 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@

##           master    #8868       +/-   ##

===========================================

- Coverage   90.18%    2.45%   -87.73%     

===========================================

  Files         151      149        -2     

  Lines      170998   165778     -5220     

===========================================

- Hits       154221     4077   -150144     

- Misses      16777   161701   +144924     
Flag Coverage Δ
huge-clang-none ?
huge-gcc-none ?
huge-gcc-testgui ?
huge-gcc-unittests 2.45% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/blob.c 0.00% <0.00%> (-92.56%) ⬇️
src/evalfunc.c 0.00% <0.00%> (-96.47%) ⬇️
src/typval.c 3.02% <0.00%> (-91.33%) ⬇️
src/float.c 0.00% <0.00%> (-99.22%) ⬇️
src/gui_gtk_f.c 0.00% <0.00%> (-97.54%) ⬇️
src/crypt_zip.c 0.00% <0.00%> (-97.06%) ⬇️
src/cmdhist.c 0.00% <0.00%> (-97.03%) ⬇️
src/match.c 0.00% <0.00%> (-96.98%) ⬇️
src/sha256.c 0.00% <0.00%> (-96.94%) ⬇️
src/evalbuffer.c 0.00% <0.00%> (-96.92%) ⬇️
... and 140 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28e591d...4c30b24. Read the comment docs.

Yegappan Lakshmanan

unread,
Sep 12, 2021, 4:54:02 PM9/12/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 6c2969e Fix the order of functions in eval.txt


You are receiving this because you are subscribed to this thread.

View it on GitHub.

Bram Moolenaar

unread,
Sep 13, 2021, 4:14:44 PM9/13/21
to vim/vim, Subscribed

check_for_blob_arg() is only used for Vim9 script, but is then followed by another check for VAR_BLOB.
Looks like when using check_for_blob_arg() always the second check can be dropped.
Similarly for check_for_list_arg() in f_list2blob().

Yegappan Lakshmanan

unread,
Sep 13, 2021, 10:21:18 PM9/13/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 33ecdc0 Simplify the argument type checks


You are receiving this because you are subscribed to this thread.

View it on GitHub.

Bram Moolenaar

unread,
Sep 14, 2021, 11:39:18 AM9/14/21
to vim/vim, Subscribed

list2blob() fails if one of the numbers is negative. As it is now, a value over 255 ends up overflowing, taking the lower 8 bits.
I think we should also fail if the number is above 255.
This is a bit strict, I suppose if someone wants to do avoids errors filtering the list first would be the solution.

Yegappan Lakshmanan

unread,
Sep 14, 2021, 11:49:40 AM9/14/21
to vim/vim, Push

@yegappan pushed 1 commit.

  • 136737d Fail list2blob() if a list item value is greater than 255


You are receiving this because you are subscribed to this thread.

View it on GitHub.

Yegappan Lakshmanan

unread,
Sep 14, 2021, 11:51:09 AM9/14/21
to vim/vim, Push

@yegappan pushed 1 commit.


You are receiving this because you are subscribed to this thread.

View it on GitHub.

Bram Moolenaar

unread,
Sep 14, 2021, 11:55:20 AM9/14/21
to vim/vim, Subscribed

Closed #8868 via 5dfe467.

Bram Moolenaar

unread,
Sep 14, 2021, 4:39:42 PM9/14/21
to vim/vim, Subscribed

Sorry for the confusion, since it was a small change I already added the check for the number value. And give an error message mentioning the invalid number, otherwise there is no clue, other than getting an empty result.
I hope this works OK, otherwise we can still change it.

Yegappan Lakshmanan

unread,
Sep 14, 2021, 10:05:34 PM9/14/21
to vim_dev, reply+ACY5DGAYFDINUJTVTU...@reply.github.com, vim/vim, Subscribed
Hi Bram,

On Tue, Sep 14, 2021 at 1:39 PM Bram Moolenaar <vim-dev...@256bit.org> wrote:

Sorry for the confusion, since it was a small change I already added the check for the number value. And give an error message mentioning the invalid number, otherwise there is no clue, other than getting an empty result.
I hope this works OK, otherwise we can still change it.



Your changes look good to me.

Regards,
Yegappan
 

vim-dev ML

unread,
Sep 14, 2021, 10:05:55 PM9/14/21
to vim/vim, vim-dev ML, Your activity

Hi Bram,

On Tue, Sep 14, 2021 at 1:39 PM Bram Moolenaar ***@***.***>

wrote:

> Sorry for the confusion, since it was a small change I already added the
> check for the number value. And give an error message mentioning the
> invalid number, otherwise there is no clue, other than getting an empty
> result.
> I hope this works OK, otherwise we can still change it.
>
>
>
Your changes look good to me.

Regards,
Yegappan
Reply all
Reply to author
Forward
0 new messages