Patch 8.2.1865
Problem:    Vim9: add() does not check type of argument.
Solution:   Inline the add() call. (closes #7160)
Files:      src/vim9.h, src/vim9compile.c, src/vim9execute.c, src/errors.h,
            src/testdir/test_vim9_func.vim,
            src/testdir/test_vim9_disassemble.vim


*** ../vim-8.2.1865/src/blob.c  2020-01-26 15:52:33.015833276 +0100
--- src/blob.c  2020-10-19 20:19:57.100712463 +0200
***************
*** 80,85 ****
--- 80,86 ----
                len = 0;
        }
        to->vval.v_blob->bv_ga.ga_len = len;
+       to->vval.v_blob->bv_ga.ga_maxlen = len;
      }
      return ret;
  }
*** ../vim-8.2.1865/src/testdir/test_vim9_func.vim      2020-10-19 
19:02:36.857261645 +0200
--- src/testdir/test_vim9_func.vim      2020-10-19 20:19:36.504772125 +0200
***************
*** 1790,1795 ****
--- 1790,1801 ----
    CheckDefExecFailure(lines, 'E1130:', 2)
  enddef
  
+ def Test_blob_add()
+   var b: blob = 0z12
+   add(b, 0x34)
+   assert_equal(0z1234, b)
+ enddef
+ 
  def SID(): number
    return expand('<SID>')
            ->matchstr('<SNR>\zs\d\+\ze_$')
*** ../vim-8.2.1865/src/version.c       2020-10-19 19:02:36.857261645 +0200
--- src/version.c       2020-10-19 20:18:04.793039621 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     1866,
  /**/

-- 
I AM THANKFUL...
...for a lawn that needs mowing, windows that need cleaning
and gutters that need fixing because it means I have a home.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/202010191822.09JIM0dc1205025%40masaka.moolenaar.net.

Raspunde prin e-mail lui