]> git.eshelyaron.com Git - emacs.git/commitdiff
; * src/lread.c (read0): Fix specpdl off-by-one bug in last change.
authorMattias Engdegård <mattiase@acm.org>
Tue, 30 Aug 2022 09:20:42 +0000 (11:20 +0200)
committerMattias Engdegård <mattiase@acm.org>
Tue, 30 Aug 2022 09:26:40 +0000 (11:26 +0200)
src/lread.c

index 15bbf46f78f7e6d3c282c323764dc0d13f7f5b30..bb376064811e7b2148f5942170754f226c97d36e 100644 (file)
@@ -3702,11 +3702,13 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
   char *read_buffer = stackbuf;
   ptrdiff_t read_buffer_size = sizeof stackbuf;
   char *heapbuf = NULL;
-  specpdl_ref count = SPECPDL_INDEX ();
 
+  specpdl_ref base_pdl = SPECPDL_INDEX ();
   ptrdiff_t base_sp = rdstack.sp;
   record_unwind_protect_intmax (read_stack_reset, base_sp);
 
+  specpdl_ref count = SPECPDL_INDEX ();
+
   bool uninterned_symbol;
   bool skip_shorthand;
 
@@ -4354,7 +4356,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
        }
     }
 
-  return unbind_to (count, obj);
+  return unbind_to (base_pdl, obj);
 }
 
 \f