From 26460328bc92605f5c3a41dc1963519299c6e266 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Nov 2022 15:19:42 +0200 Subject: [PATCH] Fix the unexec build * src/itree.c (forget_itree): New function. * src/emacs.c (Fdump_emacs): Call 'forget_itree'. --- src/emacs.c | 2 ++ src/itree.c | 8 ++++++++ src/itree.h | 1 + 3 files changed, 11 insertions(+) diff --git a/src/emacs.c b/src/emacs.c index 40ba0db340d..1b2aa9442b7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -3105,6 +3105,8 @@ You must run Emacs in batch mode in order to dump it. */) gflags.will_dump_with_unexec_ = false; gflags.dumped_with_unexec_ = true; + forget_itree (); + alloc_unexec_pre (); unexec (SSDATA (filename), !NILP (symfile) ? SSDATA (symfile) : 0); diff --git a/src/itree.c b/src/itree.c index cd37da18b89..c5e43bb0289 100644 --- a/src/itree.c +++ b/src/itree.c @@ -294,6 +294,14 @@ init_itree (void) iter = itree_iterator_create (NULL); } +#ifdef HAVE_UNEXEC +void +forget_itree (void) +{ + iter = NULL; +} +#endif + struct check_subtree_result { /* Node count of the tree. */ diff --git a/src/itree.h b/src/itree.h index d05bc7789a3..436fcfc7a07 100644 --- a/src/itree.h +++ b/src/itree.h @@ -107,6 +107,7 @@ enum itree_order }; extern void init_itree (void); +extern void forget_itree (void); extern void itree_node_init (struct itree_node *, bool, bool, Lisp_Object); extern ptrdiff_t itree_node_begin (struct itree_tree *, struct itree_node *); extern ptrdiff_t itree_node_end (struct itree_tree *, struct itree_node *); -- 2.39.2