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

patch 8.2.1739: Vim9: crash when compiling a manually defined function

Problem:    Vim9: crash when compiling a manually defined function. (Antony
            Scriven)
Solution:   Check that the script ID is positive. (closes #7012)
This commit is contained in:
Bram Moolenaar
2020-09-25 21:47:28 +02:00
parent 509f8031b2
commit 9c4f55204f
3 changed files with 29 additions and 3 deletions

View File

@@ -277,9 +277,12 @@ script_is_vim9()
lookup_script(char_u *name, size_t len, int vim9script)
{
int cc;
hashtab_T *ht = &SCRIPT_VARS(current_sctx.sc_sid);
hashtab_T *ht;
dictitem_T *di;
if (current_sctx.sc_sid <= 0)
return FAIL;
ht = &SCRIPT_VARS(current_sctx.sc_sid);
if (vim9script && !script_is_vim9())
return FAIL;
cc = name[len];