changeset 19876:87a66d23ccf5 v8.2.0494

patch 8.2.0494: Vim9: asan error Commit: https://github.com/vim/vim/commit/ea94fbe83bca69eda4f03e92ecf581d0343c7b47 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 1 22:36:49 2020 +0200 patch 8.2.0494: Vim9: asan error Problem: Vim9: asan error. Solution: Only get the type when there is one.
author Bram Moolenaar <Bram@vim.org>
date Wed, 01 Apr 2020 22:45:04 +0200
parents 06af496b8c4a
children 8aa17104800a
files src/version.c src/vim9compile.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    494,
+/**/
     493,
 /**/
     492,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3767,7 +3767,8 @@ compile_assignment(char_u *arg, exarg_T 
 	    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;