aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias EngdegÄrd2019-03-19 13:47:13 +0100
committerMattias EngdegÄrd2019-03-30 11:54:10 +0100
commitf2c14b2f01da00afdfb6c9c3e0a73d53e6e3fa62 (patch)
tree4aeb7b5083190558189a34997b4431f59f18cc68 /src
parent75ec1b1952633019f5afaf24dd87e7e4f7d31f9c (diff)
downloademacs-f2c14b2f01da00afdfb6c9c3e0a73d53e6e3fa62.tar.gz
emacs-f2c14b2f01da00afdfb6c9c3e0a73d53e6e3fa62.zip
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')
-rw-r--r--src/search.c7
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)
319 ZV_BYTE - BEGV_BYTE); 319 ZV_BYTE - BEGV_BYTE);
320 320
321 if (i == -2) 321 if (i == -2)
322 matcher_overflow (); 322 {
323 unbind_to (count, Qnil);
324 matcher_overflow ();
325 }
323 326
324 val = (i >= 0 ? Qt : Qnil); 327 val = (i >= 0 ? Qt : Qnil);
325 if (preserve_match_data && i >= 0) 328 if (preserve_match_data && i >= 0)
@@ -1198,6 +1201,7 @@ search_buffer_re (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
1198 pos_byte - BEGV_BYTE); 1201 pos_byte - BEGV_BYTE);
1199 if (val == -2) 1202 if (val == -2)
1200 { 1203 {
1204 unbind_to (count, Qnil);
1201 matcher_overflow (); 1205 matcher_overflow ();
1202 } 1206 }
1203 if (val >= 0) 1207 if (val >= 0)
@@ -1243,6 +1247,7 @@ search_buffer_re (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
1243 lim_byte - BEGV_BYTE); 1247 lim_byte - BEGV_BYTE);
1244 if (val == -2) 1248 if (val == -2)
1245 { 1249 {
1250 unbind_to (count, Qnil);
1246 matcher_overflow (); 1251 matcher_overflow ();
1247 } 1252 }
1248 if (val >= 0) 1253 if (val >= 0)