Reported by Tom Gillespie; error found by Greg Hendershott.
* src/lread.c (read_stack_reset): New.
(read0): Reset read stack when unwinding from an error.
rdstack.stack[rdstack.sp++] = e;
}
+static void
+read_stack_reset (intmax_t sp)
+{
+ eassert (sp <= rdstack.sp);
+ rdstack.sp = sp;
+}
/* Read a Lisp object.
If LOCATE_SYMS is true, symbols are read with position. */
specpdl_ref count = SPECPDL_INDEX ();
ptrdiff_t base_sp = rdstack.sp;
+ record_unwind_protect_intmax (read_stack_reset, base_sp);
bool uninterned_symbol;
bool skip_shorthand;