diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-10-21 16:49:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-10-21 16:49:17 +0200 |
commit | af7a9066a956db23a8bc67bc1f82466e3eff55ea (patch) | |
tree | 67c46dc07572890383200e7605df53bb9f56b047 /src | |
parent | ca17453e73fe69dc25a9d703804877a60763b685 (diff) | |
download | vim-git-af7a9066a956db23a8bc67bc1f82466e3eff55ea.tar.gz |
patch 8.2.1880: Vim9: asan complains about adding zero to NULLv8.2.1880
Problem: Vim9: Asan complains about adding zero to NULL.
Solution: Check for argument count first.
Diffstat (limited to 'src')
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/version.c b/src/version.c index a49bdd386..df8516154 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1880, +/**/ 1879, /**/ 1878, diff --git a/src/vim9compile.c b/src/vim9compile.c index 8ef1f0873..934b4d6b1 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -1475,11 +1475,13 @@ generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call) isn->isn_arg.shuffle.shfl_up = argoff - 1; } - // Check the types of the arguments. - argtypes = ((type_T **)stack->ga_data) + stack->ga_len - argcount; - if (argcount > 0 && internal_func_check_arg_types( - argtypes, func_idx, argcount) == FAIL) + if (argcount > 0) + { + // Check the types of the arguments. + argtypes = ((type_T **)stack->ga_data) + stack->ga_len - argcount; + if (internal_func_check_arg_types(argtypes, func_idx, argcount) == FAIL) return FAIL; + } if ((isn = generate_instr(cctx, ISN_BCALL)) == NULL) return FAIL; |