]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1765: f_isnan() and f_isinf() do not correctly initialize rettv type v9.1.1765
authorDamien Lejay <damien@lejay.be>
Mon, 15 Sep 2025 19:55:25 +0000 (19:55 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 15 Sep 2025 19:55:25 +0000 (19:55 +0000)
commit19fa46a469743653a16a48c4222482d9f33e30a2
tree235c56b0fb4a80582002a856ac80231a8217b96a
parent049c76f0e8a1cc26d724fca1a83bfd2da7012403
patch 9.1.1765: f_isnan() and f_isinf() do not correctly initialize rettv type

Problem:  f_isnan() and f_isinf() do not correctly initialize rettv type
Solution: Initialize them with type: VAR_NUMBER and value 0 (Damien Lejay).

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.

closes: #18307

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/float.c
src/version.c