patch 9.1.1765: f_isnan() and f_isinf() do not correctly initialize rettv type

Commit: 
https://github.com/vim/vim/commit/19fa46a469743653a16a48c4222482d9f33e30a2
Author: Damien Lejay <dam...@lejay.be>
Date:   Mon Sep 15 19:55:25 2025 +0000

    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 <dam...@lejay.be>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/float.c b/src/float.c
index 4c8e5fe10..fcdaaefa9 100644
--- a/src/float.c
+++ b/src/float.c
@@ -345,6 +345,9 @@ f_fmod(typval_T *argvars, typval_T *rettv)
     void
 f_isinf(typval_T *argvars, typval_T *rettv)
 {
+    rettv->v_type = VAR_NUMBER;
+    rettv->vval.v_number = 0;
+
     if (in_vim9script() && check_for_float_or_nr_arg(argvars, 0) == FAIL)
        return;
 
@@ -358,6 +361,9 @@ f_isinf(typval_T *argvars, typval_T *rettv)
     void
 f_isnan(typval_T *argvars, typval_T *rettv)
 {
+    rettv->v_type = VAR_NUMBER;
+    rettv->vval.v_number = 0;
+
     if (in_vim9script() && check_for_float_or_nr_arg(argvars, 0) == FAIL)
        return;
 
diff --git a/src/version.c b/src/version.c
index 1e231bf31..f58befda0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -724,6 +724,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1765,
 /**/
     1764,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uyFMt-008gRE-NZ%40256bit.org.

Raspunde prin e-mail lui