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

patch 8.2.1106: crash when trying to use s: variable in typed command

Problem:    Crash when trying to use s: variable in typed command.
Solution:   Don't use the script index when not set. (Ken Takata,
            closes #6366)
This commit is contained in:
Bram Moolenaar
2020-07-01 14:38:12 +02:00
parent e49b8e8d75
commit 8e6cbb7232
3 changed files with 21 additions and 1 deletions

View File

@@ -2339,6 +2339,9 @@ find_imported(char_u *name, size_t len, cctx_T *cctx)
scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
int idx;
if (current_sctx.sc_sid <= 0)
return NULL;
si = SCRIPT_ITEM(current_sctx.sc_sid);
if (cctx != NULL)
for (idx = 0; idx < cctx->ctx_imports.ga_len; ++idx)
{