Problem reported by Andy Moreton (Bug#31996).
* src/lisp.h (union specbinding.unwind_array):
Remove unused member func. Move array after nelts, as this is
likely to generate more efficient code in safe_free, which can
call xfree with the same value either way.
(safe_free): Also handle SPECPDL_UNWIND_AWAY.
} unwind;
struct {
ENUM_BF (specbind_tag) kind : CHAR_BIT;
- void (*func) (Lisp_Object);
- Lisp_Object *array;
ptrdiff_t nelts;
+ Lisp_Object *array;
} unwind_array;
struct {
ENUM_BF (specbind_tag) kind : CHAR_BIT;
while (specpdl_ptr != specpdl + sa_count)
{
specpdl_ptr--;
- eassert (specpdl_ptr->kind == SPECPDL_UNWIND_PTR
- && specpdl_ptr->unwind_ptr.func == xfree);
- xfree (specpdl_ptr->unwind_ptr.arg);
+ if (specpdl_ptr->kind == SPECPDL_UNWIND_PTR)
+ {
+ eassert (specpdl_ptr->unwind_ptr.func == xfree);
+ xfree (specpdl_ptr->unwind_ptr.arg);
+ }
+ else
+ {
+ eassert (specpdl_ptr->kind == SPECPDL_UNWIND_ARRAY);
+ xfree (specpdl_ptr->unwind_array.array);
+ }
}
}