From 90de836831c032000968bd36f353640bd115e67f Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Fri, 12 Jun 2026 16:19:37 +0000 Subject: [PATCH] Unbind specpdl when leaving replace-region-contents (bug#81169) * src/editfns.c (Freplace_region_contents): Call SPECPDL_INDEX before code_conversion_save adds specpdl entries. --- src/editfns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index 191ea0d9053..10980c96aa1 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2065,6 +2065,8 @@ a buffer or a string. But this is deprecated. */) time_limit = tlim; } + specpdl_ref count = SPECPDL_INDEX (); + /* The rest of the code is not prepared to handle a string SOURCE. */ if (!b) { @@ -2077,8 +2079,6 @@ a buffer or a string. But this is deprecated. */) } Lisp_Object source_buffer = make_lisp_ptr (b, Lisp_Vectorlike); - specpdl_ref count = SPECPDL_INDEX (); - ptrdiff_t diags = size_a + size_b + 3; ptrdiff_t bytes_per_diag = 2 * sizeof (ptrdiff_t) + sizeof (int); ptrdiff_t surplus_char_bytes = 3 * sizeof (int);