Patch 8.2.3575 (after 8.2.3574)
Problem:    Overflow check still fails when sizeof(int) == sizeof(long).
Solution:   Use a float to check the result.
Files:      src/register.c


*** ../vim-8.2.3574/src/register.c      2021-11-02 22:48:46.108940741 +0000
--- src/register.c      2021-11-02 23:06:25.257901346 +0000
***************
*** 2011,2022 ****
            }
  
            do {
                long multlen = count * yanklen;
  
                totlen = multlen;
!               if (count != 0 && yanklen != 0
!                       && (totlen != multlen || totlen / count != yanklen
!                                                || totlen / yanklen != count))
                {
                    emsg(_(e_resulting_text_too_long));
                    break;
--- 2011,2028 ----
            }
  
            do {
+ #ifdef FEAT_FLOAT
+               double multlen = (double)count * (double)yanklen;
+ 
+               totlen = count * yanklen;
+               if ((double)totlen != multlen)
+ #else
                long multlen = count * yanklen;
  
+               // this only works when sizeof(int) != sizeof(long)
                totlen = multlen;
!               if (totlen != multlen)
! #endif
                {
                    emsg(_(e_resulting_text_too_long));
                    break;
*** ../vim-8.2.3574/src/version.c       2021-11-02 22:48:46.108940741 +0000
--- src/version.c       2021-11-02 23:10:51.790810881 +0000
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     3575,
  /**/

-- 
>From "know your smileys":
 (\___/)
 (+'.'+)    Bunny
 (")_(")

 /// 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/20211102231153.09847C80053%40moolenaar.net.

Raspunde prin e-mail lui