summaryrefslogtreecommitdiffstats
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-01 22:36:49 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-01 22:36:49 +0200
commitea94fbe83bca69eda4f03e92ecf581d0343c7b47 (patch)
treeeea70daf02711d057ba23ec5214d6f882ed17168 /src/vim9compile.c
parente69f6d044c420d41dced9ba96a3b90f25788e39a (diff)
patch 8.2.0494: Vim9: asan errorv8.2.0494
Problem: Vim9: asan error. Solution: Only get the type when there is one.
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index ce1ca76c24..92d1362797 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3767,7 +3767,8 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
goto theend;
stack = &cctx->ctx_type_stack;
- stacktype = ((type_T **)stack->ga_data)[stack->ga_len - 1];
+ stacktype = stack->ga_len == 0 ? &t_void
+ : ((type_T **)stack->ga_data)[stack->ga_len - 1];
if (idx >= 0 && (is_decl || !has_type))
{
lvar = ((lvar_T *)cctx->ctx_locals.ga_data) + idx;