aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2020-04-18 23:01:43 -0400
committerStefan Monnier2020-04-18 23:01:43 -0400
commitd5ec18c66bdefb492826eab0d60e818d5bac7238 (patch)
tree9780090841d914e6ac09e091a10004bc2147a574 /src
parent4df8a6111710a68197451879f2a966ae34a90db8 (diff)
downloademacs-d5ec18c66bdefb492826eab0d60e818d5bac7238.tar.gz
emacs-d5ec18c66bdefb492826eab0d60e818d5bac7238.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/regex-emacs.c8
-rw-r--r--src/syntax.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index f456b495397..5e23fc94e4f 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -3959,9 +3959,11 @@ re_match_2_internal (struct re_pattern_buffer *bufp,
3959 3959
3960 /* Prevent shrinking and relocation of buffer text if GC happens 3960 /* Prevent shrinking and relocation of buffer text if GC happens
3961 while we are inside this function. The calls to 3961 while we are inside this function. The calls to
3962 UPDATE_SYNTAX_TABLE_* macros can trigger GC if they call Lisp, 3962 UPDATE_SYNTAX_TABLE_* macros can call Lisp (via
3963 and we have C pointers to buffer text that must not become 3963 `internal--syntax-propertize`); these calls are careful to defend against
3964 invalid as result of GC. */ 3964 buffer modifications, but even with no modifications, the buffer text may
3965 be relocated during GC by `compact_buffer` which would invalidate
3966 our C pointers to buffer text. */
3965 if (!current_buffer->text->inhibit_shrinking) 3967 if (!current_buffer->text->inhibit_shrinking)
3966 { 3968 {
3967 record_unwind_protect_ptr (unwind_re_match, current_buffer); 3969 record_unwind_protect_ptr (unwind_re_match, current_buffer);
diff --git a/src/syntax.c b/src/syntax.c
index e24b98da32a..a79ab863367 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -480,10 +480,10 @@ parse_sexp_propertize (ptrdiff_t charpos)
480 safe_call1 (Qinternal__syntax_propertize, 480 safe_call1 (Qinternal__syntax_propertize,
481 make_fixnum (min (zv, 1 + charpos))); 481 make_fixnum (min (zv, 1 + charpos)));
482 if (modiffs != CHARS_MODIFF) 482 if (modiffs != CHARS_MODIFF)
483 error ("parse-sexp-propertize-function modified the buffer!"); 483 error ("internal--syntax-propertize modified the buffer!");
484 if (syntax_propertize__done <= charpos 484 if (syntax_propertize__done <= charpos
485 && syntax_propertize__done < zv) 485 && syntax_propertize__done < zv)
486 error ("parse-sexp-propertize-function did not move" 486 error ("internal--syntax-propertize did not move"
487 " syntax-propertize--done"); 487 " syntax-propertize--done");
488 SETUP_SYNTAX_TABLE (charpos, 1); 488 SETUP_SYNTAX_TABLE (charpos, 1);
489 } 489 }