Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
23564:469359887d3e | 23565:34aa2907082a |
---|---|
1928 { | 1928 { |
1929 return global_functions[idx].f_retfunc(argcount, argtypes); | 1929 return global_functions[idx].f_retfunc(argcount, argtypes); |
1930 } | 1930 } |
1931 | 1931 |
1932 /* | 1932 /* |
1933 * Return TRUE if "idx" is for the map() function. | |
1934 */ | |
1935 int | |
1936 internal_func_is_map(int idx) | |
1937 { | |
1938 return global_functions[idx].f_func == f_map; | |
1939 } | |
1940 | |
1941 /* | |
1933 * Check the argument count to use for internal function "idx". | 1942 * Check the argument count to use for internal function "idx". |
1934 * Returns -1 for failure, 0 if no method base accepted, 1 if method base is | 1943 * Returns -1 for failure, 0 if no method base accepted, 1 if method base is |
1935 * first argument, 2 if method base is second argument, etc. 9 if method base | 1944 * first argument, 2 if method base is second argument, etc. 9 if method base |
1936 * is last argument. | 1945 * is last argument. |
1937 */ | 1946 */ |