* src/regex-emacs.c (re_match_2_internal): Rework comment in last change
Explain why we don't need to worry about Lisp modifying the buffer. * src/syntax.c (parse_sexp_propertize): Fix name in error message.
This commit is contained in:
parent
4df8a61117
commit
d5ec18c66b
2 changed files with 7 additions and 5 deletions
|
@ -3959,9 +3959,11 @@ re_match_2_internal (struct re_pattern_buffer *bufp,
|
||||||
|
|
||||||
/* Prevent shrinking and relocation of buffer text if GC happens
|
/* Prevent shrinking and relocation of buffer text if GC happens
|
||||||
while we are inside this function. The calls to
|
while we are inside this function. The calls to
|
||||||
UPDATE_SYNTAX_TABLE_* macros can trigger GC if they call Lisp,
|
UPDATE_SYNTAX_TABLE_* macros can call Lisp (via
|
||||||
and we have C pointers to buffer text that must not become
|
`internal--syntax-propertize`); these calls are careful to defend against
|
||||||
invalid as result of GC. */
|
buffer modifications, but even with no modifications, the buffer text may
|
||||||
|
be relocated during GC by `compact_buffer` which would invalidate
|
||||||
|
our C pointers to buffer text. */
|
||||||
if (!current_buffer->text->inhibit_shrinking)
|
if (!current_buffer->text->inhibit_shrinking)
|
||||||
{
|
{
|
||||||
record_unwind_protect_ptr (unwind_re_match, current_buffer);
|
record_unwind_protect_ptr (unwind_re_match, current_buffer);
|
||||||
|
|
|
@ -480,10 +480,10 @@ parse_sexp_propertize (ptrdiff_t charpos)
|
||||||
safe_call1 (Qinternal__syntax_propertize,
|
safe_call1 (Qinternal__syntax_propertize,
|
||||||
make_fixnum (min (zv, 1 + charpos)));
|
make_fixnum (min (zv, 1 + charpos)));
|
||||||
if (modiffs != CHARS_MODIFF)
|
if (modiffs != CHARS_MODIFF)
|
||||||
error ("parse-sexp-propertize-function modified the buffer!");
|
error ("internal--syntax-propertize modified the buffer!");
|
||||||
if (syntax_propertize__done <= charpos
|
if (syntax_propertize__done <= charpos
|
||||||
&& syntax_propertize__done < zv)
|
&& syntax_propertize__done < zv)
|
||||||
error ("parse-sexp-propertize-function did not move"
|
error ("internal--syntax-propertize did not move"
|
||||||
" syntax-propertize--done");
|
" syntax-propertize--done");
|
||||||
SETUP_SYNTAX_TABLE (charpos, 1);
|
SETUP_SYNTAX_TABLE (charpos, 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue