]> granicus.if.org Git - vim/commitdiff
patch 9.0.1075: build fails if compiler doesn't allow declaration after case v9.0.1075
authorBram Moolenaar <Bram@vim.org>
Sun, 18 Dec 2022 22:01:42 +0000 (22:01 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 18 Dec 2022 22:01:42 +0000 (22:01 +0000)
Problem:    build fails if the compiler doesn't allow for a declaration right
            after "case".
Solution:   Add a block.

src/version.c
src/vim9instr.c

index 0c7c50f99f4136bad3e86dd2883b2a0b4addb342..a734f555d07b307ddb34a335da7f160911882767 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1075,
 /**/
     1074,
 /**/
index 8bd2485f6c6240f07191b5b87fe7f7027405a6a7..4a22d1829182362f8d755b89b4f0f8bb6055375a 100644 (file)
@@ -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;
+               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
+                   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;
-               }
+                   {
+                       // "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,
+                   // "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);
+           }
        case dest_class_member:
            return generate_CLASSMEMBER(cctx, FALSE,
                                     lhs->lhs_class, lhs->lhs_classmember_idx);