diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/charset.c | 4 | ||||
| -rw-r--r-- | src/charset.h | 2 | ||||
| -rw-r--r-- | src/pdumper.c | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/charset.c b/src/charset.c index 56ab8d70181..c0700f972ee 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -62,8 +62,8 @@ Lisp_Object Vcharset_hash_table; | |||
| 62 | 62 | ||
| 63 | /* Table of struct charset. */ | 63 | /* Table of struct charset. */ |
| 64 | struct charset *charset_table; | 64 | struct charset *charset_table; |
| 65 | static int charset_table_size; | 65 | int charset_table_size; |
| 66 | int charset_table_used; | 66 | static int charset_table_used; |
| 67 | 67 | ||
| 68 | /* Special charsets corresponding to symbols. */ | 68 | /* Special charsets corresponding to symbols. */ |
| 69 | int charset_ascii; | 69 | int charset_ascii; |
diff --git a/src/charset.h b/src/charset.h index ee697b8d3ef..7042a71a469 100644 --- a/src/charset.h +++ b/src/charset.h | |||
| @@ -248,7 +248,7 @@ extern Lisp_Object Vcharset_hash_table; | |||
| 248 | 248 | ||
| 249 | /* Table of struct charset. */ | 249 | /* Table of struct charset. */ |
| 250 | extern struct charset *charset_table; | 250 | extern struct charset *charset_table; |
| 251 | extern int charset_table_used; | 251 | extern int charset_table_size; |
| 252 | 252 | ||
| 253 | #define CHARSET_FROM_ID(id) (charset_table + (id)) | 253 | #define CHARSET_FROM_ID(id) (charset_table + (id)) |
| 254 | 254 | ||
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) | |||
| 3212 | ctx->flags.pack_objects = true; | 3212 | ctx->flags.pack_objects = true; |
| 3213 | dump_align_output (ctx, DUMP_ALIGNMENT); | 3213 | dump_align_output (ctx, DUMP_ALIGNMENT); |
| 3214 | dump_off offset = ctx->offset; | 3214 | dump_off offset = ctx->offset; |
| 3215 | for (int i = 0; i < charset_table_used; ++i) | 3215 | /* We are dumping the entire table, not just the used slots, because |
| 3216 | otherwise when we restore from the pdump file, the actual size of | ||
| 3217 | the table will be smaller than charset_table_size, and we will | ||
| 3218 | crash if/when a new charset is defined. */ | ||
| 3219 | for (int i = 0; i < charset_table_size; ++i) | ||
| 3216 | dump_charset (ctx, i); | 3220 | dump_charset (ctx, i); |
| 3217 | dump_emacs_reloc_to_dump_ptr_raw (ctx, &charset_table, offset); | 3221 | dump_emacs_reloc_to_dump_ptr_raw (ctx, &charset_table, offset); |
| 3218 | ctx->flags = old_flags; | 3222 | ctx->flags = old_flags; |