Mercurial > vim
comparison src/screen.c @ 14161:7cac4646c552 v8.1.0098
patch 8.1.0098: segfault when pattern with z() is very slow
commit https://github.com/vim/vim/commit/bcf9442307075bac40d44328c8bf7ea21857b138
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 23 14:21:42 2018 +0200
patch 8.1.0098: segfault when pattern with \z() is very slow
Problem: Segfault when pattern with \z() is very slow.
Solution: Check for NULL regprog. Add "nfa_fail" to test_override() to be
able to test this. Fix that 'searchhl' resets called_emsg.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Jun 2018 14:30:07 +0200 |
parents | a9d94f10ecef |
children | 2ad722003b36 |
comparison
equal
deleted
inserted
replaced
14160:de4575cbbb2b | 14161:7cac4646c552 |
---|---|
7866 matchitem_T *cur) /* to retrieve match positions if any */ | 7866 matchitem_T *cur) /* to retrieve match positions if any */ |
7867 { | 7867 { |
7868 linenr_T l; | 7868 linenr_T l; |
7869 colnr_T matchcol; | 7869 colnr_T matchcol; |
7870 long nmatched; | 7870 long nmatched; |
7871 int save_called_emsg = called_emsg; | |
7871 | 7872 |
7872 if (shl->lnum != 0) | 7873 if (shl->lnum != 0) |
7873 { | 7874 { |
7874 /* Check for three situations: | 7875 /* Check for three situations: |
7875 * 1. If the "lnum" is below a previous match, start a new search. | 7876 * 1. If the "lnum" is below a previous match, start a new search. |
7984 { | 7985 { |
7985 shl->lnum += shl->rm.startpos[0].lnum; | 7986 shl->lnum += shl->rm.startpos[0].lnum; |
7986 break; /* useful match found */ | 7987 break; /* useful match found */ |
7987 } | 7988 } |
7988 } | 7989 } |
7990 | |
7991 // Restore called_emsg for assert_fails(). | |
7992 called_emsg = save_called_emsg; | |
7989 } | 7993 } |
7990 | 7994 |
7991 /* | 7995 /* |
7992 * If there is a match fill "shl" and return one. | 7996 * If there is a match fill "shl" and return one. |
7993 * Return zero otherwise. | 7997 * Return zero otherwise. |