mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 8.2.1443: Vim9: crash when interrupting a nested :def function
Problem: Vim9: crash when interrupting a nested :def function. Solution: Push a dummy return value onto the stack. (closes #6701)
This commit is contained in:
parent
be7529e889
commit
cdd70f09a5
@ -754,6 +754,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 */
|
||||||
|
/**/
|
||||||
|
1443,
|
||||||
/**/
|
/**/
|
||||||
1442,
|
1442,
|
||||||
/**/
|
/**/
|
||||||
|
@ -915,16 +915,17 @@ call_def_function(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// not inside try or need to return from current functions.
|
// Not inside try or need to return from current functions.
|
||||||
|
// Push a dummy return value.
|
||||||
|
if (GA_GROW(&ectx.ec_stack, 1) == FAIL)
|
||||||
|
goto failed;
|
||||||
|
tv = STACK_TV_BOT(0);
|
||||||
|
tv->v_type = VAR_NUMBER;
|
||||||
|
tv->vval.v_number = 0;
|
||||||
|
++ectx.ec_stack.ga_len;
|
||||||
if (ectx.ec_frame_idx == initial_frame_idx)
|
if (ectx.ec_frame_idx == initial_frame_idx)
|
||||||
{
|
{
|
||||||
// At the toplevel we are done. Push a dummy return value.
|
// At the toplevel we are done.
|
||||||
if (GA_GROW(&ectx.ec_stack, 1) == FAIL)
|
|
||||||
goto failed;
|
|
||||||
tv = STACK_TV_BOT(0);
|
|
||||||
tv->v_type = VAR_NUMBER;
|
|
||||||
tv->vval.v_number = 0;
|
|
||||||
++ectx.ec_stack.ga_len;
|
|
||||||
need_rethrow = TRUE;
|
need_rethrow = TRUE;
|
||||||
if (handle_closure_in_use(&ectx, FALSE) == FAIL)
|
if (handle_closure_in_use(&ectx, FALSE) == FAIL)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user