To: vim_dev@googlegroups.com Subject: Patch 8.2.4880 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4880 Problem: Vim9: misplaced elseif causes invalid memory access. Solution: Check cs_idx not to be negative. Files: src/ex_eval.c *** ../vim-8.2.4879/src/ex_eval.c 2022-05-05 17:02:41.494034106 +0100 --- src/ex_eval.c 2022-05-06 11:26:20.056878950 +0100 *************** *** 1124,1133 **** skip = TRUE; } ! // Variables declared in the previous block can no longer be ! // used. Needs to be done before setting "cs_flags". ! leave_block(cstack); ! enter_block(cstack); // if skipping or the ":if" was TRUE, reset ACTIVE, otherwise set it if (skip || cstack->cs_flags[cstack->cs_idx] & CSF_TRUE) --- 1124,1136 ---- skip = TRUE; } ! if (cstack->cs_idx >= 0) ! { ! // Variables declared in the previous block can no longer be ! // used. Needs to be done before setting "cs_flags". ! leave_block(cstack); ! enter_block(cstack); ! } // if skipping or the ":if" was TRUE, reset ACTIVE, otherwise set it if (skip || cstack->cs_flags[cstack->cs_idx] & CSF_TRUE) *** ../vim-8.2.4879/src/version.c 2022-05-06 11:21:13.961097837 +0100 --- src/version.c 2022-05-06 11:27:19.492832599 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4880, /**/ -- hundred-and-one symptoms of being an internet addict: 111. You and your friends get together regularly on IRC, even though all of you live in the same street. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///