0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.2131: Vim9: crash when lambda uses same var as assignment

Problem:    Vim9: crash when lambda uses same var as assignment.
Solution:   Do not let lookup_local change lv_from_outer, make a copy.
            (closes #7461)
This commit is contained in:
Bram Moolenaar
2020-12-12 14:33:41 +01:00
parent cc2335896b
commit 709664cca0
7 changed files with 66 additions and 47 deletions

View File

@@ -3271,7 +3271,7 @@ skip_option_env_lead(char_u *start)
find_ex_command(
exarg_T *eap,
int *full UNUSED,
void *(*lookup)(char_u *, size_t, cctx_T *) UNUSED,
int (*lookup)(char_u *, size_t, void *, cctx_T *) UNUSED,
cctx_T *cctx UNUSED)
{
int len;
@@ -3387,7 +3387,7 @@ find_ex_command(
|| *eap->cmd == '&'
|| *eap->cmd == '$'
|| *eap->cmd == '@'
|| lookup(eap->cmd, p - eap->cmd, cctx) != NULL)
|| lookup(eap->cmd, p - eap->cmd, NULL, cctx) == OK)
{
eap->cmdidx = CMD_var;
return eap->cmd;