mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.4216: Vim9: cannot use a function from an autoload import directly
Problem: Vim9: cannot use a function from an autoload import directly. Solution: Add the AUTOLOAD instruction to figure out at runtime. (closes #9620)
This commit is contained in:
@@ -743,6 +743,23 @@ generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate an ISN_AUTOLOAD instruction.
|
||||
*/
|
||||
int
|
||||
generate_AUTOLOAD(cctx_T *cctx, char_u *name, type_T *type)
|
||||
{
|
||||
isn_T *isn;
|
||||
|
||||
RETURN_OK_IF_SKIP(cctx);
|
||||
if ((isn = generate_instr_type(cctx, ISN_AUTOLOAD, type)) == NULL)
|
||||
return FAIL;
|
||||
isn->isn_arg.string = vim_strsave(name);
|
||||
if (isn->isn_arg.string == NULL)
|
||||
return FAIL;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate an ISN_GETITEM instruction with "index".
|
||||
* "with_op" is TRUE for "+=" and other operators, the stack has the current
|
||||
@@ -1929,6 +1946,7 @@ delete_instr(isn_T *isn)
|
||||
{
|
||||
switch (isn->isn_type)
|
||||
{
|
||||
case ISN_AUTOLOAD:
|
||||
case ISN_DEF:
|
||||
case ISN_EXEC:
|
||||
case ISN_EXECRANGE:
|
||||
|
Reference in New Issue
Block a user