comparison src/vim9instr.c @ 27086:1e2a6c6c7e42 v8.2.4072

patch 8.2.4072: Vim9: compiling function fails when autoload is not loaded Commit: https://github.com/vim/vim/commit/d041f4208b0a2149e9d41f6443aa1c14c076a411 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 12 19:54:00 2022 +0000 patch 8.2.4072: Vim9: compiling function fails when autoload is not loaded Problem: Vim9: compiling function fails when autoload script is not loaded yet. Solution: Depend on runtime loading.
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Jan 2022 21:00:05 +0100
parents 18cafa092e8d
children 98a01021e465
comparison
equal deleted inserted replaced
27085:40b273e28f26 27086:1e2a6c6c7e42
712 return OK; 712 return OK;
713 } 713 }
714 714
715 /* 715 /*
716 * Generate an ISN_PUSHFUNC instruction with name "name". 716 * Generate an ISN_PUSHFUNC instruction with name "name".
717 * Consumes "name".
718 */ 717 */
719 int 718 int
720 generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type) 719 generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type)
721 { 720 {
722 isn_T *isn; 721 isn_T *isn;
725 RETURN_OK_IF_SKIP(cctx); 724 RETURN_OK_IF_SKIP(cctx);
726 if ((isn = generate_instr_type(cctx, ISN_PUSHFUNC, type)) == NULL) 725 if ((isn = generate_instr_type(cctx, ISN_PUSHFUNC, type)) == NULL)
727 return FAIL; 726 return FAIL;
728 if (name == NULL) 727 if (name == NULL)
729 funcname = NULL; 728 funcname = NULL;
730 else if (*name == K_SPECIAL) // script-local 729 else if (*name == K_SPECIAL // script-local
730 || vim_strchr(name, AUTOLOAD_CHAR) != NULL) // autoload
731 funcname = vim_strsave(name); 731 funcname = vim_strsave(name);
732 else 732 else
733 { 733 {
734 funcname = alloc(STRLEN(name) + 3); 734 funcname = alloc(STRLEN(name) + 3);
735 if (funcname != NULL) 735 if (funcname != NULL)