patch 8.2.0735: Vim9: using unitialized memory
Problem: Vim9: using unitialized memory.
Solution: Clear the arg_lvar field.
diff --git a/src/version.c b/src/version.c
index 19920de..96ca889 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 735,
+/**/
734,
/**/
733,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index c8c87e7..99246e0 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -4762,18 +4762,20 @@
}
lvar = lookup_local(arg, varlen, cctx);
- if (lvar == NULL
- && lookup_arg(arg, varlen,
+ if (lvar == NULL)
+ {
+ CLEAR_FIELD(arg_lvar);
+ if (lookup_arg(arg, varlen,
&arg_lvar.lv_idx, &arg_lvar.lv_type,
&arg_lvar.lv_from_outer, cctx) == OK)
- {
- if (is_decl)
{
- semsg(_(e_used_as_arg), name);
- goto theend;
+ if (is_decl)
+ {
+ semsg(_(e_used_as_arg), name);
+ goto theend;
+ }
+ lvar = &arg_lvar;
}
- arg_lvar.lv_const = 0;
- lvar = &arg_lvar;
}
if (lvar != NULL)
{