changeset 30335:bff0506a0911 v9.0.0503

patch 9.0.0503: build failure Commit: https://github.com/vim/vim/commit/65449bd1ee5cebde288a8f0150fe7d54c6c6ef31 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 19 16:02:43 2022 +0100 patch 9.0.0503: build failure Problem: Build failure. Solution: Add missing changes.
author Bram Moolenaar <Bram@vim.org>
date Mon, 19 Sep 2022 17:15:03 +0200
parents 945eb46e0773
children cf5fed99ae1e
files src/version.c src/vim9compile.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -700,6 +700,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    503,
+/**/
     502,
 /**/
     501,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -54,7 +54,9 @@ lookup_local(char_u *name, size_t len, l
 	    {
 		*lvar = *lvp;
 		lvar->lv_from_outer = 0;
-		lvar->lv_loop_idx = get_loop_var_idx(cctx);
+		// If the variable was declared inside a loop set
+		// lvar->lv_loop_idx and lvar->lv_loop_depth.
+		get_loop_var_idx(cctx, idx, lvar);
 	    }
 	    return OK;
 	}
@@ -955,8 +957,7 @@ compile_nested_function(exarg_T *eap, cc
     // recursive call.
     if (is_global)
     {
-	// TODO: loop variable index and count
-	r = generate_NEWFUNC(cctx, lambda_name, func_name, 0, 0);
+	r = generate_NEWFUNC(cctx, lambda_name, func_name);
 	func_name = NULL;
 	lambda_name = NULL;
     }
@@ -1195,7 +1196,7 @@ generate_loadvar(
 	    {
 		if (lvar->lv_from_outer > 0)
 		    generate_LOADOUTER(cctx, lvar->lv_idx, lvar->lv_from_outer,
-						      lvar->lv_loop_idx, type);
+				 lvar->lv_loop_depth, lvar->lv_loop_idx, type);
 		else
 		    generate_LOAD(cctx, ISN_LOAD, lvar->lv_idx, NULL, type);
 	    }