0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0724: closure in compiled function gets same variable in block

Problem:    Closure in compiled function gets same variable in block.
Solution:   At the end of a block to not always reset the variable count.
            (issue #11094)
This commit is contained in:
Bram Moolenaar
2022-10-11 20:04:09 +01:00
parent a9a364872e
commit a275f2cdcc
4 changed files with 49 additions and 18 deletions

View File

@@ -47,7 +47,8 @@ lookup_local(char_u *name, size_t len, lvar_T *lvar, cctx_T *cctx)
for (idx = 0; idx < cctx->ctx_locals.ga_len; ++idx)
{
lvp = ((lvar_T *)cctx->ctx_locals.ga_data) + idx;
if (STRNCMP(name, lvp->lv_name, len) == 0
if (lvp->lv_name != NULL
&& STRNCMP(name, lvp->lv_name, len) == 0
&& STRLEN(lvp->lv_name) == len)
{
if (lvar != NULL)