comparison src/eval.c @ 25358:f03271631eb5 v8.2.3216

patch 8.2.3216: Vim9: crash when using variable in a loop at script level Commit: https://github.com/vim/vim/commit/2eb6fc3b52148f961e804ec2be361d531ff770d8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 25 14:13:53 2021 +0200 patch 8.2.3216: Vim9: crash when using variable in a loop at script level 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 25 Jul 2021 14:15:04 +0200
parents 0aac8880d74d
children 7124992f26ef
comparison
equal deleted inserted replaced
25357:2cf7cefa5bfa 25358:f03271631eb5
144 void 144 void
145 fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, int skip) 145 fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, int skip)
146 { 146 {
147 CLEAR_FIELD(*evalarg); 147 CLEAR_FIELD(*evalarg);
148 evalarg->eval_flags = skip ? 0 : EVAL_EVALUATE; 148 evalarg->eval_flags = skip ? 0 : EVAL_EVALUATE;
149 if (eap != NULL && getline_equal(eap->getline, eap->cookie, getsourceline)) 149 if (eap != NULL)
150 { 150 {
151 evalarg->eval_getline = eap->getline; 151 evalarg->eval_cstack = eap->cstack;
152 evalarg->eval_cookie = eap->cookie; 152 if (getline_equal(eap->getline, eap->cookie, getsourceline))
153 {
154 evalarg->eval_getline = eap->getline;
155 evalarg->eval_cookie = eap->cookie;
156 }
153 } 157 }
154 } 158 }
155 159
156 /* 160 /*
157 * Top level evaluation function, returning a boolean. 161 * Top level evaluation function, returning a boolean.