comparison src/vim9type.c @ 23481:62fe9a7fd582 v8.2.2283

patch 8.2.2283: Vim9: crash when lambda has fewer arguments than expected Commit: https://github.com/vim/vim/commit/e68b02a1c40388bbb85e7b825bc538298963e1e1 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 3 13:09:51 2021 +0100 patch 8.2.2283: Vim9: crash when lambda has fewer arguments than expected Problem: Vim9: crash when lambda has fewer arguments than expected. Solution: Don't check arguments when already failed. (closes https://github.com/vim/vim/issues/7606)
author Bram Moolenaar <Bram@vim.org>
date Sun, 03 Jan 2021 13:15:04 +0100
parents 681f042ae5ac
children 27ca5534a408
comparison
equal deleted inserted replaced
23480:4d63776659b9 23481:62fe9a7fd582
488 FALSE, 0); 488 FALSE, 0);
489 if (ret == OK && expected->tt_argcount != -1 489 if (ret == OK && expected->tt_argcount != -1
490 && actual->tt_argcount != -1 490 && actual->tt_argcount != -1
491 && (actual->tt_argcount < expected->tt_min_argcount 491 && (actual->tt_argcount < expected->tt_min_argcount
492 || actual->tt_argcount > expected->tt_argcount)) 492 || actual->tt_argcount > expected->tt_argcount))
493 ret = FAIL; 493 ret = FAIL;
494 if (expected->tt_args != NULL && actual->tt_args != NULL) 494 if (ret == OK && expected->tt_args != NULL
495 && actual->tt_args != NULL)
495 { 496 {
496 int i; 497 int i;
497 498
498 for (i = 0; i < expected->tt_argcount; ++i) 499 for (i = 0; i < expected->tt_argcount; ++i)
499 // Allow for using "any" argument type, lambda's have them. 500 // Allow for using "any" argument type, lambda's have them.