diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-01-03 12:33:26 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-03 12:33:26 +0000 |
commit | 36818a9daafbcb8e3b06be7b07f52b2d00a61746 (patch) | |
tree | 36946401734f25b5a814e2b1d83b3f68587c8cee /src/vim9type.c | |
parent | ea720aea851e645f4c8ec3b20afb27c7ca38184c (diff) |
patch 9.0.1138: crash when expecting varargs but it is something elsev9.0.1138
Problem: Crash when expecting varargs but it is something else.
Solution: Only use the member when the type is a list. (closes #11774)
Diffstat (limited to 'src/vim9type.c')
-rw-r--r-- | src/vim9type.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vim9type.c b/src/vim9type.c index 436a42de51..8ce5948163 100644 --- a/src/vim9type.c +++ b/src/vim9type.c @@ -932,8 +932,10 @@ check_argument_types( if (varargs && i >= type->tt_argcount - 1) { expected = type->tt_args[type->tt_argcount - 1]; - if (expected != NULL) + if (expected != NULL && expected->tt_type == VAR_LIST) expected = expected->tt_member; + if (expected == NULL) + expected = &t_any; } else expected = type->tt_args[i]; |