Patch 8.2.1695
Problem: Vim9: crash when using varargs type "any".
Solution: Check if uf_va_type is &t_any. (closes #6957)
Files: src/vim9compile.c, src/vim9execute.c,
src/testdir/test_vim9_func.vim
*** ../vim-8.2.1694/src/vim9compile.c 2020-09-16 15:21:56.354720354 +0200
--- src/vim9compile.c 2020-09-16 17:18:29.844854273 +0200
***************
*** 1430,1437 ****
continue;
expected = ufunc->uf_arg_types[i];
}
! else if (ufunc->uf_va_type == NULL)
! // possibly a lambda
expected = &t_any;
else
expected = ufunc->uf_va_type->tt_member;
--- 1430,1437 ----
continue;
expected = ufunc->uf_arg_types[i];
}
! else if (ufunc->uf_va_type == NULL || ufunc->uf_va_type == &t_any)
! // possibly a lambda or "...: any"
expected = &t_any;
else
expected = ufunc->uf_va_type->tt_member;
*** ../vim-8.2.1694/src/vim9execute.c 2020-09-16 15:21:56.354720354 +0200
--- src/vim9execute.c 2020-09-16 17:16:25.269403347 +0200
***************
*** 829,834 ****
--- 829,835 ----
// Check the type of the list items.
tv = STACK_TV_BOT(-1);
if (ufunc->uf_va_type != NULL
+ && ufunc->uf_va_type != &t_any
&& ufunc->uf_va_type->tt_member != &t_any
&& tv->vval.v_list != NULL)
{
*** ../vim-8.2.1694/src/testdir/test_vim9_func.vim 2020-09-16
15:21:56.358720340 +0200
--- src/testdir/test_vim9_func.vim 2020-09-16 17:20:30.040325738 +0200
***************
*** 321,326 ****
--- 321,335 ----
lines =<< trim END
vim9script
+ def Func(...l: any)
+ echo l
+ enddef
+ Func(0)
+ END
+ CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
def Func(...l: list<string>)
echo l
enddef
*** ../vim-8.2.1694/src/version.c 2020-09-16 15:46:04.881061899 +0200
--- src/version.c 2020-09-16 17:22:26.367815052 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1695,
/**/
--
An SQL statement walks into a bar. He approaches two tables
and says, "Mind if I join you?"
/// 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/202009161529.08GFThJL2173768%40masaka.moolenaar.net.