diff 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
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -7868,6 +7868,7 @@ next_search_hl(
     linenr_T	l;
     colnr_T	matchcol;
     long	nmatched;
+    int		save_called_emsg = called_emsg;
 
     if (shl->lnum != 0)
     {
@@ -7986,6 +7987,9 @@ next_search_hl(
 	    break;			/* useful match found */
 	}
     }
+
+    // Restore called_emsg for assert_fails().
+    called_emsg = save_called_emsg;
 }
 
 /*