]> granicus.if.org Git - vim/commitdiff
patch 8.2.0494: Vim9: asan error v8.2.0494
authorBram Moolenaar <Bram@vim.org>
Wed, 1 Apr 2020 20:36:49 +0000 (22:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 1 Apr 2020 20:36:49 +0000 (22:36 +0200)
Problem:    Vim9: asan error.
Solution:   Only get the type when there is one.

src/version.c
src/vim9compile.c

index 3686a1d51b1267fb43d2b27f8a5f7b57bc1f70af..de0565a80f6d2dee64e2d1bb9525b1bae0efd256 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    494,
 /**/
     493,
 /**/
index ce1ca76c24b51fa6296565a3e3a9de2b77d91ce0..92d13627974d7171ad0529a6813735d1f9daddb5 100644 (file)
@@ -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;