Patch 9.0.1076
Problem:    ASAN complains about NULL argument.
Solution:   Skip memmove() when there is nothing to move.
Files:      src/vim9class.c


*** ../vim-9.0.1075/src/vim9class.c     2022-12-18 21:42:49.010716927 +0000
--- src/vim9class.c     2022-12-19 12:16:16.520328897 +0000
***************
*** 164,170 ****
      *members = gap->ga_len == 0 ? NULL : ALLOC_MULT(ocmember_T, gap->ga_len);
      if (gap->ga_len > 0 && *members == NULL)
        return FAIL;
!     mch_memmove(*members, gap->ga_data, sizeof(ocmember_T) * gap->ga_len);
      VIM_CLEAR(gap->ga_data);
      return OK;
  }
--- 164,171 ----
      *members = gap->ga_len == 0 ? NULL : ALLOC_MULT(ocmember_T, gap->ga_len);
      if (gap->ga_len > 0 && *members == NULL)
        return FAIL;
!     if (gap->ga_len > 0)
!       mch_memmove(*members, gap->ga_data, sizeof(ocmember_T) * gap->ga_len);
      VIM_CLEAR(gap->ga_data);
      return OK;
  }
*** ../vim-9.0.1075/src/version.c       2022-12-18 22:01:38.873926637 +0000
--- src/version.c       2022-12-19 12:17:02.788283081 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1076,
  /**/

-- 
CUSTOMER:     You're not fooling anyone y'know.  Look, isn't there something
              you can do?
DEAD PERSON:  I feel happy... I feel happy.
    [whop]
CUSTOMER:     Ah, thanks very much.
MORTICIAN:    Not at all.  See you on Thursday.
CUSTOMER:     Right.
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221219121940.1A78C1C09DC%40moolenaar.net.

Raspunde prin e-mail lui