Commit f2c14b2f authored by Mattias Engdegård's avatar Mattias Engdegård

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).
parent 75ec1b19
Pipeline #1112 failed with stage
in 52 minutes and 40 seconds
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment