[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master f2c14b2 2/2: Release regexp before signalling overf
From: |
Mattias Engdegård |
Subject: |
[Emacs-diffs] master f2c14b2 2/2: Release regexp before signalling overflow error |
Date: |
Sat, 30 Mar 2019 06:58:36 -0400 (EDT) |
branch: master
commit f2c14b2f01da00afdfb6c9c3e0a73d53e6e3fa62
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
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).
---
src/search.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/search.c b/src/search.c
index 07ff0e4..a450e92 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)