0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1764: Vim9: no error when assigning to script var with wrong type

Problem:    Vim9: no error when assigning to script var with wrong type.
Solution:   Fix off-by-one error. (closes #7028)
This commit is contained in:
Bram Moolenaar
2020-09-27 21:27:40 +02:00
parent 6c542f77eb
commit 06f9c6940a
3 changed files with 13 additions and 1 deletions

View File

@@ -4899,7 +4899,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
{
scriptvar_idx = get_script_item_idx(scriptvar_sid,
rawname, TRUE);
if (scriptvar_idx > 0)
if (scriptvar_idx >= 0)
{
scriptitem_T *si = SCRIPT_ITEM(scriptvar_sid);
svar_T *sv =