• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision97aaede2b4e04b3d229a8a5f86f7eb4cda1a02a1 (tree)
Time2022-12-19 07:15:02
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

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.

Change Summary

Incremental Difference

diff -r 53afa4db03fe -r 97aaede2b4e0 src/version.c
--- a/src/version.c Sun Dec 18 22:45:05 2022 +0100
+++ b/src/version.c Sun Dec 18 23:15:02 2022 +0100
@@ -696,6 +696,8 @@
696696 static int included_patches[] =
697697 { /* Add new patch number below this line */
698698 /**/
699+ 1075,
700+/**/
699701 1074,
700702 /**/
701703 1073,
diff -r 53afa4db03fe -r 97aaede2b4e0 src/vim9instr.c
--- a/src/vim9instr.c Sun Dec 18 22:45:05 2022 +0100
+++ b/src/vim9instr.c Sun Dec 18 23:15:02 2022 +0100
@@ -2188,29 +2188,32 @@
21882188 case dest_vimvar:
21892189 return generate_STORE(cctx, ISN_STOREV, vimvaridx, NULL);
21902190 case dest_script:
2191- int scriptvar_idx = lhs->lhs_scriptvar_idx;
2192- int scriptvar_sid = lhs->lhs_scriptvar_sid;
2193- if (scriptvar_idx < 0)
21942191 {
2195- isntype_T isn_type = ISN_STORES;
2196-
2197- if (SCRIPT_ID_VALID(scriptvar_sid)
2198- && SCRIPT_ITEM(scriptvar_sid)->sn_import_autoload
2199- && SCRIPT_ITEM(scriptvar_sid)->sn_autoload_prefix
2200- == NULL)
2192+ int scriptvar_idx = lhs->lhs_scriptvar_idx;
2193+ int scriptvar_sid = lhs->lhs_scriptvar_sid;
2194+ if (scriptvar_idx < 0)
22012195 {
2202- // "import autoload './dir/script.vim'" - load script first
2203- if (generate_SOURCE(cctx, scriptvar_sid) == FAIL)
2204- return FAIL;
2205- isn_type = ISN_STOREEXPORT;
2206- }
2196+ isntype_T isn_type = ISN_STORES;
22072197
2208- // "s:" may be included in the name.
2209- return generate_OLDSCRIPT(cctx, isn_type, name,
2210- scriptvar_sid, type);
2198+ if (SCRIPT_ID_VALID(scriptvar_sid)
2199+ && SCRIPT_ITEM(scriptvar_sid)->sn_import_autoload
2200+ && SCRIPT_ITEM(scriptvar_sid)->sn_autoload_prefix
2201+ == NULL)
2202+ {
2203+ // "import autoload './dir/script.vim'" - load script
2204+ // first
2205+ if (generate_SOURCE(cctx, scriptvar_sid) == FAIL)
2206+ return FAIL;
2207+ isn_type = ISN_STOREEXPORT;
2208+ }
2209+
2210+ // "s:" may be included in the name.
2211+ return generate_OLDSCRIPT(cctx, isn_type, name,
2212+ scriptvar_sid, type);
2213+ }
2214+ return generate_VIM9SCRIPT(cctx, ISN_STORESCRIPT,
2215+ scriptvar_sid, scriptvar_idx, type);
22112216 }
2212- return generate_VIM9SCRIPT(cctx, ISN_STORESCRIPT,
2213- scriptvar_sid, scriptvar_idx, type);
22142217 case dest_class_member:
22152218 return generate_CLASSMEMBER(cctx, FALSE,
22162219 lhs->lhs_class, lhs->lhs_classmember_idx);
Show on old repository browser