Mercurial > vim
comparison src/syntax.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 | 115aed6c544c |
children | 1c79c92a642e |
comparison
equal
deleted
inserted
replaced
14160:de4575cbbb2b | 14161:7cac4646c552 |
---|---|
3324 proftime_T pt; | 3324 proftime_T pt; |
3325 | 3325 |
3326 if (syn_time_on) | 3326 if (syn_time_on) |
3327 profile_start(&pt); | 3327 profile_start(&pt); |
3328 #endif | 3328 #endif |
3329 | |
3330 if (rmp->regprog == NULL) | |
3331 // This can happen if a previous call to vim_regexec_multi() tried to | |
3332 // use the NFA engine, which resulted in NFA_TOO_EXPENSIVE, and | |
3333 // compiling the pattern with the other engine fails. | |
3334 return FALSE; | |
3329 | 3335 |
3330 rmp->rmm_maxcol = syn_buf->b_p_smc; | 3336 rmp->rmm_maxcol = syn_buf->b_p_smc; |
3331 r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, | 3337 r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, |
3332 #ifdef FEAT_RELTIME | 3338 #ifdef FEAT_RELTIME |
3333 syn_tm, &timed_out | 3339 syn_tm, &timed_out |