summaryrefslogtreecommitdiff
path: root/src/vim9cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-30 11:04:50 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-30 11:04:50 +0100
commit6586a015144f15a979d573a79d91e700e4b3009f (patch)
treee276ff392ab6f428c169b2fb0b8646643109bd44 /src/vim9cmds.c
parentb152b6a40f729ed81a25d2fa541a4e73e201bec4 (diff)
downloadvim-git-6586a015144f15a979d573a79d91e700e4b3009f.tar.gz
patch 9.0.0627: "const" and "final" both make the type a constantv9.0.0627
Problem: "const" and "final" both make the type a constant. (Daniel Steinberg) Solution: Only have "const" make the type a constant.
Diffstat (limited to 'src/vim9cmds.c')
-rw-r--r--src/vim9cmds.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vim9cmds.c b/src/vim9cmds.c
index c9c222c47..3c561d1ef 100644
--- a/src/vim9cmds.c
+++ b/src/vim9cmds.c
@@ -881,7 +881,7 @@ compile_for(char_u *arg_start, cctx_T *cctx)
// Reserve a variable to store the loop iteration counter and initialize it
// to -1.
- loop_lvar = reserve_local(cctx, (char_u *)"", 0, FALSE, &t_number);
+ loop_lvar = reserve_local(cctx, (char_u *)"", 0, ASSIGN_VAR, &t_number);
if (loop_lvar == NULL)
{
drop_scope(cctx);
@@ -894,7 +894,7 @@ compile_for(char_u *arg_start, cctx_T *cctx)
// Reserve a variable to store ec_funcrefs.ga_len, used in ISN_ENDLOOP.
// The variable index is always the loop var index plus one.
// It is not used when no closures are encountered, we don't know yet.
- funcref_lvar = reserve_local(cctx, (char_u *)"", 0, FALSE, &t_number);
+ funcref_lvar = reserve_local(cctx, (char_u *)"", 0, ASSIGN_VAR, &t_number);
if (funcref_lvar == NULL)
{
drop_scope(cctx);
@@ -1050,7 +1050,8 @@ compile_for(char_u *arg_start, cctx_T *cctx)
&& need_type_where(item_type, lhs_type, -1,
where, cctx, FALSE, FALSE) == FAIL)
goto failed;
- var_lvar = reserve_local(cctx, arg, varlen, TRUE, lhs_type);
+ var_lvar = reserve_local(cctx, arg, varlen, ASSIGN_CONST,
+ lhs_type);
if (var_lvar == NULL)
// out of memory or used as an argument
goto failed;
@@ -1182,7 +1183,7 @@ compile_while(char_u *arg, cctx_T *cctx)
// Reserve a variable to store ec_funcrefs.ga_len, used in ISN_ENDLOOP.
// It is not used when no closures are encountered, we don't know yet.
- funcref_lvar = reserve_local(cctx, (char_u *)"", 0, FALSE, &t_number);
+ funcref_lvar = reserve_local(cctx, (char_u *)"", 0, ASSIGN_VAR, &t_number);
if (funcref_lvar == NULL)
{
drop_scope(cctx);