From: Nicolás Bértolo Date: Sat, 30 May 2020 00:03:00 +0000 (-0300) Subject: Do not call `gensym' too early when loading a dump file. X-Git-Tag: emacs-28.0.90~2727^2~606 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb9c0188ea3881a555415de7e6fe7973911719e9;p=emacs.git Do not call `gensym' too early when loading a dump file. This happened when subr.eln was not the first native compilation unit to be loaded. register_native_comp_unit() is called when loading a native compilation unit and that in turn used to call `gensym', which was not loaded yet. This led to a SIGSEGV. * src/comp.c (register_native_comp_unit): Replace the call to `gensym' with an ad-hoc counter. --- diff --git a/src/comp.c b/src/comp.c index 32a98173d53..d3bff1e4cfe 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4120,7 +4120,12 @@ static void register_native_comp_unit (Lisp_Object comp_u) { #ifdef WINDOWSNT - Fputhash (CALL1I (gensym, Qnil), comp_u, all_loaded_comp_units_h); + /* We have to do this since we can't use `gensym'. This function is + called early when loading a dump file and subr.el may not have + been loaded yet. */ + static intmax_t count; + + Fputhash (make_int (count++), comp_u, all_loaded_comp_units_h); #endif }