summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-10 23:20:06 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-10 23:20:06 +0200
commitbc38f25c021dc4314c77d50a608329a328b0d988 (patch)
tree9579f338c882e77b3a8969d707887840e0f9a9fd
parent04816717dfea6e2469ff4c9d40f68b59aaf03724 (diff)
patch 8.2.0735: Vim9: using unitialized memoryv8.2.0735
Problem: Vim9: using unitialized memory. Solution: Clear the arg_lvar field.
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c18
2 files changed, 12 insertions, 8 deletions
diff --git a/src/version.c b/src/version.c
index 19920dea87..96ca8898ae 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
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 c8c87e737f..99246e07df 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -4762,18 +4762,20 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
}
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)
{