comparison src/evalvars.c @ 25751:fc8046209eaa v8.2.3411

patch 8.2.3411: Vim9: crash when using base name of import Commit: https://github.com/vim/vim/commit/6853c38b78fe5333f95470e1ff3ca6741247e600 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 7 22:12:19 2021 +0200 patch 8.2.3411: Vim9: crash when using base name of import Problem: Vim9: crash when using base name of import. (Naohiro Ono) Solution: Check the import flags. (closes https://github.com/vim/vim/issues/8843)
author Bram Moolenaar <Bram@vim.org>
date Tue, 07 Sep 2021 22:15:03 +0200
parents c26eb08a0df2
children b2c00659152a
comparison
equal deleted inserted replaced
25750:06e0400d9d69 25751:fc8046209eaa
3258 if ((flags & ASSIGN_NO_DECL) == 0) 3258 if ((flags & ASSIGN_NO_DECL) == 0)
3259 { 3259 {
3260 semsg(_(e_redefining_imported_item_str), name); 3260 semsg(_(e_redefining_imported_item_str), name);
3261 goto failed; 3261 goto failed;
3262 } 3262 }
3263 if (import->imp_flags & IMP_FLAGS_STAR)
3264 {
3265 semsg(_(e_cannot_use_str_itself_it_is_imported_with_star),
3266 name);
3267 goto failed;
3268 }
3263 sv = ((svar_T *)si->sn_var_vals.ga_data) + import->imp_var_vals_idx; 3269 sv = ((svar_T *)si->sn_var_vals.ga_data) + import->imp_var_vals_idx;
3264 3270
3265 where.wt_variable = TRUE; 3271 where.wt_variable = TRUE;
3266 if (check_typval_type(sv->sv_type, tv, where) == FAIL 3272 if (check_typval_type(sv->sv_type, tv, where) == FAIL
3267 || value_check_lock(sv->sv_tv->v_lock, name, FALSE)) 3273 || value_check_lock(sv->sv_tv->v_lock, name, FALSE))