summaryrefslogtreecommitdiff
path: root/src/pdumper.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-03-17 17:49:37 +0200
committerEli Zaretskii <eliz@gnu.org>2019-03-17 17:49:37 +0200
commit03a9a75c5b8bfb5187bffdcca2d52419ef5f950a (patch)
treeccc06fa4e20656fc119b59e215052894e5ea4a3d /src/pdumper.c
parent3320fe2deeba6dcc40e934e8a03bef4945c86aff (diff)
downloademacs-03a9a75c5b8bfb5187bffdcca2d52419ef5f950a.tar.gz
Fix 'define-charset' after dumping with pdumper
* src/charset.h: * src/charset.c (charset_table_used): Now static. (charset_table_size): Now extern. * src/pdumper.c (dump_charset_table): Dump the entire charset_table, not just its used slots. (Bug#34826)
Diffstat (limited to 'src/pdumper.c')
-rw-r--r--src/pdumper.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pdumper.c b/src/pdumper.c
index 56ac531363d..92e19497e59 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -3212,7 +3212,11 @@ dump_charset_table (struct dump_context *ctx)
ctx->flags.pack_objects = true;
dump_align_output (ctx, DUMP_ALIGNMENT);
dump_off offset = ctx->offset;
- for (int i = 0; i < charset_table_used; ++i)
+ /* We are dumping the entire table, not just the used slots, because
+ otherwise when we restore from the pdump file, the actual size of
+ the table will be smaller than charset_table_size, and we will
+ crash if/when a new charset is defined. */
+ for (int i = 0; i < charset_table_size; ++i)
dump_charset (ctx, i);
dump_emacs_reloc_to_dump_ptr_raw (ctx, &charset_table, offset);
ctx->flags = old_flags;