Problem: Crash when using cpp syntax file with pattern using external
match. (Havard Garnes)
Solution: Discard match when end column is before start column.
{
/* Only accept single line matches. */
if (reg_startzpos[i].lnum >= 0
- && reg_endzpos[i].lnum == reg_startzpos[i].lnum)
+ && reg_endzpos[i].lnum == reg_startzpos[i].lnum
+ && reg_endzpos[i].col >= reg_startzpos[i].col)
re_extmatch_out->matches[i] =
vim_strnsave(reg_getline(reg_startzpos[i].lnum)
+ reg_startzpos[i].col,
{
struct multipos *mpos = &subs.synt.list.multi[i];
- /* Only accept single line matches. */
- if (mpos->start.lnum >= 0 && mpos->start.lnum == mpos->end.lnum)
+ /* Only accept single line matches that are valid. */
+ if (mpos->start.lnum >= 0
+ && mpos->start.lnum == mpos->end.lnum
+ && mpos->end.col >= mpos->start.col)
re_extmatch_out->matches[i] =
vim_strnsave(reg_getline(mpos->start.lnum)
+ mpos->start.col,
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 253,
/**/
252,
/**/