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:
@@ -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];
|
||||
|
Reference in New Issue
Block a user