diff 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
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -3260,6 +3260,12 @@ set_var_const(
 		semsg(_(e_redefining_imported_item_str), name);
 		goto failed;
 	    }
+	    if (import->imp_flags & IMP_FLAGS_STAR)
+	    {
+		semsg(_(e_cannot_use_str_itself_it_is_imported_with_star),
+									 name);
+		goto failed;
+	    }
 	    sv = ((svar_T *)si->sn_var_vals.ga_data) + import->imp_var_vals_idx;
 
 	    where.wt_variable = TRUE;