diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-03-19 13:47:13 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-03-30 11:54:10 +0100 |
commit | f2c14b2f01da00afdfb6c9c3e0a73d53e6e3fa62 (patch) | |
tree | 4aeb7b5083190558189a34997b4431f59f18cc68 /src/search.c | |
parent | 75ec1b1952633019f5afaf24dd87e7e4f7d31f9c (diff) | |
download | emacs-f2c14b2f01da00afdfb6c9c3e0a73d53e6e3fa62.tar.gz |
Release regexp before signalling overflow error
* src/search.c (looking_at_1, search_buffer_re): Unfreeze the regexp
buffer before signalling a matcher overflow, since the error
processing may require quite some regexp use as well (Bug#34910).
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c index 07ff0e47643..a450e920b03 100644 --- a/src/search.c +++ b/src/search.c @@ -319,7 +319,10 @@ looking_at_1 (Lisp_Object string, bool posix) ZV_BYTE - BEGV_BYTE); if (i == -2) - matcher_overflow (); + { + unbind_to (count, Qnil); + matcher_overflow (); + } val = (i >= 0 ? Qt : Qnil); if (preserve_match_data && i >= 0) @@ -1198,6 +1201,7 @@ search_buffer_re (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, pos_byte - BEGV_BYTE); if (val == -2) { + unbind_to (count, Qnil); matcher_overflow (); } if (val >= 0) @@ -1243,6 +1247,7 @@ search_buffer_re (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, lim_byte - BEGV_BYTE); if (val == -2) { + unbind_to (count, Qnil); matcher_overflow (); } if (val >= 0) |