diff options
| author | Bram Moolenaar <Bram@vim.org> | 2022-05-22 13:45:52 +0100 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2022-05-22 13:45:52 +0100 |
| commit | bce69d65dd41020ea1d727337a3baf9e95b40c35 (patch) | |
| tree | 63ac7567a44b3dbe4677d781076118283893c66e /src/vim9type.c | |
| parent | 37233f6022b3ed16985a91d22752b3ca162e21d0 (diff) | |
| download | vim-git-8.2.4998.tar.gz | |
patch 8.2.4998: Vim9: crash when using multiple funcref()v8.2.4998
Problem: Vim9: crash when using multiple funcref().
Solution: Check if varargs type is NULL. (closes #10467)
Diffstat (limited to 'src/vim9type.c')
| -rw-r--r-- | src/vim9type.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vim9type.c b/src/vim9type.c index 180876223..436feda51 100644 --- a/src/vim9type.c +++ b/src/vim9type.c @@ -807,7 +807,11 @@ check_argument_types( else tv = &argvars[i]; if (varargs && i >= type->tt_argcount - 1) - expected = type->tt_args[type->tt_argcount - 1]->tt_member; + { + expected = type->tt_args[type->tt_argcount - 1]; + if (expected != NULL) + expected = expected->tt_member; + } else expected = type->tt_args[i]; if (check_typval_arg_type(expected, tv, NULL, i + 1) == FAIL) |
