diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-25 14:13:53 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-25 14:13:53 +0200 |
commit | 2eb6fc3b52148f961e804ec2be361d531ff770d8 (patch) | |
tree | 860366c5e83de91ee2531177158a60dcf7c13e3f /src/eval.c | |
parent | 5bca906b307728fa74a112914dc55b424d512d39 (diff) |
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/eval.c')
-rw-r--r-- | src/eval.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c index fdee0089b3..fc2266225a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -146,10 +146,14 @@ fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, int skip) { CLEAR_FIELD(*evalarg); evalarg->eval_flags = skip ? 0 : EVAL_EVALUATE; - if (eap != NULL && getline_equal(eap->getline, eap->cookie, getsourceline)) + if (eap != NULL) { - evalarg->eval_getline = eap->getline; - evalarg->eval_cookie = eap->cookie; + evalarg->eval_cstack = eap->cstack; + if (getline_equal(eap->getline, eap->cookie, getsourceline)) + { + evalarg->eval_getline = eap->getline; + evalarg->eval_cookie = eap->cookie; + } } } |