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).
This commit is contained in:
Mattias Engdegård 2019-03-19 13:47:13 +01:00
parent 75ec1b1952
commit f2c14b2f01

View file

@ -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)