Skip to content

Commit

Permalink
patch 8.2.3998: asan error for adding zero to NULL
Browse files Browse the repository at this point in the history
Problem:    Asan error for adding zero to NULL.
Solution:   Do not compute pointer if there are no entries.
  • Loading branch information
brammool committed Jan 4, 2022
1 parent 10d6f18 commit 48824e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3998,
/**/
3997,
/**/
Expand Down
3 changes: 2 additions & 1 deletion src/vim9type.c
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ get_member_type_from_stack(
cctx_T *cctx)
{
garray_T *stack = &cctx->ctx_type_stack;
type2_T *typep = ((type2_T *)stack->ga_data) + stack->ga_len;
type2_T *typep;
garray_T *type_gap = cctx->ctx_type_list;
int i;
type_T *result;
Expand All @@ -1283,6 +1283,7 @@ get_member_type_from_stack(

// Use the first value type for the list member type, then find the common
// type from following items.
typep = ((type2_T *)stack->ga_data) + stack->ga_len;
result = (typep -(count * skip) + skip - 1)->type_curr;
decl_result = (typep -(count * skip) + skip - 1)->type_decl;
for (i = 1; i < count; ++i)
Expand Down

0 comments on commit 48824e9

Please sign in to comment.