From 7debd69b331f2068c7d0d6975263b2f8ea089fe4 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Tue, 2 Jul 2024 00:18:58 +0000 Subject: [PATCH 2/2] try to fix face-related crashes --- src/xfaces.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xfaces.c b/src/xfaces.c index 2bdd2f660fd..ee26a260ed4 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2970,9 +2970,15 @@ DEFUN ("internal-make-lisp-face", Finternal_make_lisp_face, The mapping from Lisp face to Lisp face id is given by the property `face' of the Lisp face name. */ if (next_lface_id == lface_id_to_name_size) +#ifdef HAVE_MPS + lface_id_to_name = + igc_xpalloc_ambig (lface_id_to_name, &lface_id_to_name_size, 1, MAX_FACE_ID, + sizeof *lface_id_to_name); +#else lface_id_to_name = xpalloc (lface_id_to_name, &lface_id_to_name_size, 1, MAX_FACE_ID, sizeof *lface_id_to_name); +#endif Lisp_Object face_id = make_fixnum (next_lface_id); lface_id_to_name[next_lface_id] = face; @@ -7326,7 +7332,11 @@ init_xfaces (void) { /* Allocate the lface_id_to_name[] array. */ lface_id_to_name_size = next_lface_id = nfaces; +#ifdef HAVE_MPS + lface_id_to_name = igc_xzalloc_ambig (next_lface_id * sizeof *lface_id_to_name); +#else lface_id_to_name = xnmalloc (next_lface_id, sizeof *lface_id_to_name); +#endif /* Store the faces. */ struct Lisp_Hash_Table* table = XHASH_TABLE (Vface_new_frame_defaults); -- 2.45.2