Mercurial > vim
diff src/evalfunc.c @ 23565:34aa2907082a v8.2.2325
patch 8.2.2325: Vim9: crash if map() changes the item type
Commit: https://github.com/vim/vim/commit/75ab91ff3403e725a79ac9c7351b78e9aff71d67
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 10 22:42:50 2021 +0100
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 https://github.com/vim/vim/issues/7652)
Fix problem with mapnew() on range list.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 10 Jan 2021 22:45:06 +0100 |
parents | 87671ccc6c6b |
children | 510088f8c66f |
line wrap: on
line diff
--- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -1930,6 +1930,15 @@ internal_func_ret_type(int idx, int argc } /* + * 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 * first argument, 2 if method base is second argument, etc. 9 if method base