Mercurial > vim
changeset 31485:97aaede2b4e0 v9.0.1075
patch 9.0.1075: build fails if compiler doesn't allow declaration after case
Commit: https://github.com/vim/vim/commit/c336ae3ce60a2f047b72344ac827568606c5aa15
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Dec 18 22:01:42 2022 +0000
patch 9.0.1075: build fails if compiler doesn't allow declaration after case
Problem: build fails if the compiler doesn't allow for a declaration right
after "case".
Solution: Add a block.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 18 Dec 2022 23:15:02 +0100 |
parents | 53afa4db03fe |
children | 96ff54827295 |
files | src/version.c src/vim9instr.c |
diffstat | 2 files changed, 24 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1075, +/**/ 1074, /**/ 1073,
--- a/src/vim9instr.c +++ b/src/vim9instr.c @@ -2188,29 +2188,32 @@ generate_store_var( case dest_vimvar: return generate_STORE(cctx, ISN_STOREV, vimvaridx, NULL); case dest_script: - int scriptvar_idx = lhs->lhs_scriptvar_idx; - int scriptvar_sid = lhs->lhs_scriptvar_sid; - if (scriptvar_idx < 0) { - isntype_T isn_type = ISN_STORES; - - if (SCRIPT_ID_VALID(scriptvar_sid) - && SCRIPT_ITEM(scriptvar_sid)->sn_import_autoload - && SCRIPT_ITEM(scriptvar_sid)->sn_autoload_prefix - == NULL) + int scriptvar_idx = lhs->lhs_scriptvar_idx; + int scriptvar_sid = lhs->lhs_scriptvar_sid; + if (scriptvar_idx < 0) { - // "import autoload './dir/script.vim'" - load script first - if (generate_SOURCE(cctx, scriptvar_sid) == FAIL) - return FAIL; - isn_type = ISN_STOREEXPORT; - } + isntype_T isn_type = ISN_STORES; - // "s:" may be included in the name. - return generate_OLDSCRIPT(cctx, isn_type, name, - scriptvar_sid, type); + if (SCRIPT_ID_VALID(scriptvar_sid) + && SCRIPT_ITEM(scriptvar_sid)->sn_import_autoload + && SCRIPT_ITEM(scriptvar_sid)->sn_autoload_prefix + == NULL) + { + // "import autoload './dir/script.vim'" - load script + // first + if (generate_SOURCE(cctx, scriptvar_sid) == FAIL) + return FAIL; + isn_type = ISN_STOREEXPORT; + } + + // "s:" may be included in the name. + return generate_OLDSCRIPT(cctx, isn_type, name, + scriptvar_sid, type); + } + return generate_VIM9SCRIPT(cctx, ISN_STORESCRIPT, + scriptvar_sid, scriptvar_idx, type); } - return generate_VIM9SCRIPT(cctx, ISN_STORESCRIPT, - scriptvar_sid, scriptvar_idx, type); case dest_class_member: return generate_CLASSMEMBER(cctx, FALSE, lhs->lhs_class, lhs->lhs_classmember_idx);