summaryrefslogtreecommitdiff
path: root/src/evalvars.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-25 14:13:53 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-25 14:13:53 +0200
commit2eb6fc3b52148f961e804ec2be361d531ff770d8 (patch)
tree860366c5e83de91ee2531177158a60dcf7c13e3f /src/evalvars.c
parent5bca906b307728fa74a112914dc55b424d512d39 (diff)
downloadvim-git-2eb6fc3b52148f961e804ec2be361d531ff770d8.tar.gz
patch 8.2.3216: Vim9: crash when using variable in a loop at script levelv8.2.3216
Problem: Vim9: crash when using variable in a loop at script level. Solution: Do not clear the variable if a function was defined. Do not create a new entry in sn_var_vals every time. (closes #8628)
Diffstat (limited to 'src/evalvars.c')
-rw-r--r--src/evalvars.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/evalvars.c b/src/evalvars.c
index 1f781dad7..534163c54 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -880,13 +880,7 @@ ex_let(exarg_T *eap)
if (eap->skip)
++emsg_skip;
- CLEAR_FIELD(evalarg);
- evalarg.eval_flags = eap->skip ? 0 : EVAL_EVALUATE;
- if (getline_equal(eap->getline, eap->cookie, getsourceline))
- {
- evalarg.eval_getline = eap->getline;
- evalarg.eval_cookie = eap->cookie;
- }
+ fill_evalarg_from_eap(&evalarg, eap, eap->skip);
expr = skipwhite_and_linebreak(expr, &evalarg);
cur_lnum = SOURCING_LNUM;
i = eval0(expr, &rettv, eap, &evalarg);