[vim/vim] float.c: set v_type in f_isinf() and f_isnan() (PR #18307)

11 views
Skip to first unread message

Damien Lejay

unread,
Sep 15, 2025, 12:13:41 PM (8 days ago) Sep 15
to vim/vim, Subscribed

Both builtins wrote only rettv->vval.v_number and relied on call_func() initialising rettv->v_type to VAR_NUMBER. Explicitly set

    rettv->v_type = VAR_NUMBER;
    rettv->vval.v_number = 0;

at function entry to avoid undefined behaviour and make the return type self-contained.


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

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

Commit Summary

  • 61f7416 float.c: set v_type in f_isinf() and f_isnan()

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18307@github.com>

Christian Brabandt

unread,
Sep 15, 2025, 3:55:50 PM (8 days ago) Sep 15
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18307)

thanks, makes sense


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18307/c3293704968@github.com>

Christian Brabandt

unread,
Sep 15, 2025, 3:59:15 PM (8 days ago) Sep 15
to vim/vim, Subscribed

Closed #18307 via 19fa46a.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18307/issue_event/19709701984@github.com>

zeertzjq

unread,
Sep 15, 2025, 6:23:07 PM (7 days ago) Sep 15
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#18307)

I don't think this is a good idea. call_func() initializing rettv->v_type to VAR_NUMBER is a good thing to rely on.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18307/c3294174533@github.com>

Christian Brabandt

unread,
Sep 16, 2025, 3:19:28 PM (7 days ago) Sep 16
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18307)

Hm, I see. I just don't like the implicit dependency on call_func() for setting the type. If you think it doesn't make sense, I can revert it again.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18307/c3300034548@github.com>

Reply all
Reply to author
Forward
0 new messages