mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.2.4880: Vim9: misplaced elseif causes invalid memory access
Problem: Vim9: misplaced elseif causes invalid memory access. Solution: Check cs_idx not to be negative.
This commit is contained in:
@@ -1124,10 +1124,13 @@ ex_else(exarg_T *eap)
|
|||||||
skip = TRUE;
|
skip = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cstack->cs_idx >= 0)
|
||||||
|
{
|
||||||
// Variables declared in the previous block can no longer be
|
// Variables declared in the previous block can no longer be
|
||||||
// used. Needs to be done before setting "cs_flags".
|
// used. Needs to be done before setting "cs_flags".
|
||||||
leave_block(cstack);
|
leave_block(cstack);
|
||||||
enter_block(cstack);
|
enter_block(cstack);
|
||||||
|
}
|
||||||
|
|
||||||
// if skipping or the ":if" was TRUE, reset ACTIVE, otherwise set it
|
// if skipping or the ":if" was TRUE, reset ACTIVE, otherwise set it
|
||||||
if (skip || cstack->cs_flags[cstack->cs_idx] & CSF_TRUE)
|
if (skip || cstack->cs_flags[cstack->cs_idx] & CSF_TRUE)
|
||||||
|
@@ -746,6 +746,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 */
|
||||||
|
/**/
|
||||||
|
4880,
|
||||||
/**/
|
/**/
|
||||||
4879,
|
4879,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user