Mercurial > vim
diff src/vim9execute.c @ 23098:bdafc132a4a1 v8.2.2095
patch 8.2.2095: Vim9: crash when failed dict member is followed by concat
Commit: https://github.com/vim/vim/commit/4029cabbe7c68a304ab8becb495bd6d91c6e97b1
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 5 18:13:27 2020 +0100
patch 8.2.2095: Vim9: crash when failed dict member is followed by concat
Problem: Vim9: crash when failed dict member is followed by concatenation.
Solution: Remove the dict from the stack. (closes https://github.com/vim/vim/issues/7416)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Dec 2020 18:15:04 +0100 |
parents | cd885eb0e50c |
children | 9c3a6c33c0e5 |
line wrap: on
line diff
--- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -2669,6 +2669,15 @@ call_def_function( { SOURCING_LNUM = iptr->isn_lnum; semsg(_(e_dictkey), key); + + // If :silent! is used we will continue, make sure the + // stack contents makes sense. + clear_tv(tv); + --ectx.ec_stack.ga_len; + tv = STACK_TV_BOT(-1); + clear_tv(tv); + tv->v_type = VAR_NUMBER; + tv->vval.v_number = 0; goto on_fatal_error; } clear_tv(tv);