aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorDaniel Colascione2019-01-16 14:37:21 -0500
committerDaniel Colascione2019-01-16 14:37:28 -0500
commitece563e8eda4aac77923df13c5e8e8032c69b9b3 (patch)
treec596f0ea3097defa9c812d63e8d448d61954b0d2 /src/coding.c
parent8bf51c380acc04f25fba8f8aa3d1cc08b45f3e69 (diff)
downloademacs-ece563e8eda4aac77923df13c5e8e8032c69b9b3.tar.gz
emacs-ece563e8eda4aac77923df13c5e8e8032c69b9b3.zip
Fix crash in charset detection after pdumper load
* src/coding.c: (reset_coding_after_pdumper_load): new function re-init character classes after pdumper load. (syms_of_coding): Call it.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c
index 665aefa34c8..441c85f81a3 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -10774,6 +10774,8 @@ init_coding_once (void)
10774 PDUMPER_REMEMBER_SCALAR (emacs_mule_bytes); 10774 PDUMPER_REMEMBER_SCALAR (emacs_mule_bytes);
10775} 10775}
10776 10776
10777static void reset_coding_after_pdumper_load (void);
10778
10777void 10779void
10778syms_of_coding (void) 10780syms_of_coding (void)
10779{ 10781{
@@ -11316,4 +11318,27 @@ internal character representation. */);
11316 system_eol_type = Qunix; 11318 system_eol_type = Qunix;
11317#endif 11319#endif
11318 staticpro (&system_eol_type); 11320 staticpro (&system_eol_type);
11321
11322 pdumper_do_now_and_after_load_impl (reset_coding_after_pdumper_load);
11323}
11324
11325static void
11326reset_coding_after_pdumper_load (void)
11327{
11328 if (!dumped_with_pdumper_p ())
11329 return;
11330 for (struct coding_system *this = &coding_categories[0];
11331 this < &coding_categories[coding_category_max];
11332 ++this)
11333 {
11334 int id = this->id;
11335 if (id >= 0)
11336 {
11337 /* Need to rebuild the coding system object because we
11338 persisted it as a scalar and it's full of gunk that's now
11339 invalid. */
11340 memset (this, 0, sizeof (*this));
11341 setup_coding_system (CODING_ID_NAME (id), this);
11342 }
11343 }
11319} 11344}