0
0
mirror of https://github.com/vim/vim.git synced 2025-10-10 06:24:10 -04:00

patch 8.2.2325: Vim9: crash if map() changes the item type

Problem:    Vim9: crash if map() changes the item type.
Solution:   Check that the item type is still OK. (closes #7652)
            Fix problem with mapnew() on range list.
This commit is contained in:
Bram Moolenaar
2021-01-10 22:42:50 +01:00
parent 6f02b00bb0
commit 75ab91ff34
8 changed files with 50 additions and 18 deletions

View File

@@ -1929,6 +1929,15 @@ internal_func_ret_type(int idx, int argcount, type_T **argtypes)
return global_functions[idx].f_retfunc(argcount, argtypes);
}
/*
* Return TRUE if "idx" is for the map() function.
*/
int
internal_func_is_map(int idx)
{
return global_functions[idx].f_func == f_map;
}
/*
* Check the argument count to use for internal function "idx".
* Returns -1 for failure, 0 if no method base accepted, 1 if method base is