diff options
author | Florian Walch <florian@fwalch.com> | 2014-12-24 14:24:05 +0100 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2014-12-27 11:33:59 +0100 |
commit | 0e8c39bd3b3f5ae07faa677114508f5dc219a235 (patch) | |
tree | 647b9d701df08c2aea7500c8428a39d2ecd85771 /src | |
parent | 4ff4b9306d9ccd26c6e7c8e9b663788aa53d84ec (diff) | |
download | rneovim-0e8c39bd3b3f5ae07faa677114508f5dc219a235.tar.gz rneovim-0e8c39bd3b3f5ae07faa677114508f5dc219a235.tar.bz2 rneovim-0e8c39bd3b3f5ae07faa677114508f5dc219a235.zip |
vim-patch:7.4.528
Problem: Crash when using matchadd() (Yasuhiro Matsumoto)
Solution: Copy the match regprog.
https://code.google.com/p/vim/source/detail?r=v7-4-528
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 11 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 324171aca2..855c09619e 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5738,7 +5738,18 @@ next_search_hl ( shl->lnum = lnum; if (shl->rm.regprog != NULL) { + /* Remember whether shl->rm is using a copy of the regprog in + * cur->match. */ + bool regprog_is_copy = (shl != &search_hl + && cur != NULL + && shl == &cur->hl + && cur->match.regprog == cur->hl.rm.regprog); + nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum, matchcol, &(shl->tm)); + /* Copy the regprog, in case it got freed and recompiled. */ + if (regprog_is_copy) { + cur->match.regprog = cur->hl.rm.regprog; + } if (called_emsg || got_int) { // Error while handling regexp: stop using this regexp. if (shl == &search_hl) { diff --git a/src/nvim/version.c b/src/nvim/version.c index 8a0ab1c7e3..58047e7232 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -210,7 +210,7 @@ static int included_patches[] = { //531, //530, //529, - //528, + 528, 527, //526, //525, |