comparison src/vim9compile.c @ 22276:753452747ae5 v8.2.1687

patch 8.2.1687: Vim9: out of bounds error Commit: https://github.com/vim/vim/commit/9b123d859053ad1fb91d38334726b9f24da39930 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 14 22:39:11 2020 +0200 patch 8.2.1687: Vim9: out of bounds error Problem: Vim9: out of bounds error. Solution: Check that cmdidx is not negative.
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Sep 2020 22:45:03 +0200
parents 1634ca41e4d3
children 6b385c2b9ff5
comparison
equal deleted inserted replaced
22275:216928dbf078 22276:753452747ae5
6901 6901
6902 p = skipwhite(p); 6902 p = skipwhite(p);
6903 if (ea.cmdidx != CMD_SIZE 6903 if (ea.cmdidx != CMD_SIZE
6904 && ea.cmdidx != CMD_write && ea.cmdidx != CMD_read) 6904 && ea.cmdidx != CMD_write && ea.cmdidx != CMD_read)
6905 { 6905 {
6906 ea.argt = excmd_get_argt(ea.cmdidx); 6906 if (ea.cmdidx >= 0)
6907 ea.argt = excmd_get_argt(ea.cmdidx);
6907 if ((ea.argt & EX_BANG) && *p == '!') 6908 if ((ea.argt & EX_BANG) && *p == '!')
6908 { 6909 {
6909 ea.forceit = TRUE; 6910 ea.forceit = TRUE;
6910 p = skipwhite(p + 1); 6911 p = skipwhite(p + 1);
6911 } 6912 }