comparison src/vim9compile.c @ 21110:8fb0e507491d v8.2.1106

patch 8.2.1106: crash when trying to use s: variable in typed command Commit: https://github.com/vim/vim/commit/8e6cbb72324b6fb25d1a9abd6cc4d102d0e5f14e Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 1 14:38:12 2020 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Wed, 01 Jul 2020 14:45:05 +0200
parents d9e0db9b2b99
children 9b57c92991c6
comparison
equal deleted inserted replaced
21109:35e5bb8acfc9 21110:8fb0e507491d
2337 find_imported(char_u *name, size_t len, cctx_T *cctx) 2337 find_imported(char_u *name, size_t len, cctx_T *cctx)
2338 { 2338 {
2339 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid); 2339 scriptitem_T *si = SCRIPT_ITEM(current_sctx.sc_sid);
2340 int idx; 2340 int idx;
2341 2341
2342 if (current_sctx.sc_sid <= 0)
2343 return NULL;
2344 si = SCRIPT_ITEM(current_sctx.sc_sid);
2342 if (cctx != NULL) 2345 if (cctx != NULL)
2343 for (idx = 0; idx < cctx->ctx_imports.ga_len; ++idx) 2346 for (idx = 0; idx < cctx->ctx_imports.ga_len; ++idx)
2344 { 2347 {
2345 imported_T *import = ((imported_T *)cctx->ctx_imports.ga_data) 2348 imported_T *import = ((imported_T *)cctx->ctx_imports.ga_data)
2346 + idx; 2349 + idx;