mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.3175: Vim9: using illegal pointer with nested lambdas.
Problem: Vim9: using illegal pointer with inline function inside a lambda. Solution: Clear eval_tofree_cmdline when advancing to the next line. (closes #8578)
This commit is contained in:
@@ -2177,6 +2177,11 @@ eval_next_line(evalarg_T *evalarg)
|
|||||||
vim_free(evalarg->eval_tofree);
|
vim_free(evalarg->eval_tofree);
|
||||||
evalarg->eval_tofree = line;
|
evalarg->eval_tofree = line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Advanced to the next line, "arg" no longer points into the previous
|
||||||
|
// line.
|
||||||
|
VIM_CLEAR(evalarg->eval_tofree_cmdline);
|
||||||
|
|
||||||
return skipwhite(line);
|
return skipwhite(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2265,6 +2265,22 @@ def Test_nested_inline_lambda()
|
|||||||
})
|
})
|
||||||
END
|
END
|
||||||
CheckScriptSuccess(lines)
|
CheckScriptSuccess(lines)
|
||||||
|
|
||||||
|
lines =<< trim END
|
||||||
|
vim9script
|
||||||
|
|
||||||
|
def s:func()
|
||||||
|
range(10)
|
||||||
|
->mapnew((_, _) => ({
|
||||||
|
key: range(10)->mapnew((_, _) => {
|
||||||
|
return ' '
|
||||||
|
}),
|
||||||
|
}))
|
||||||
|
enddef
|
||||||
|
|
||||||
|
defcomp
|
||||||
|
END
|
||||||
|
CheckScriptSuccess(lines)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Shadowed(): list<number>
|
def Shadowed(): list<number>
|
||||||
|
@@ -755,6 +755,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
3175,
|
||||||
/**/
|
/**/
|
||||||
3174,
|
3174,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user