From bb9c0188ea3881a555415de7e6fe7973911719e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicol=C3=A1s=20B=C3=A9rtolo?= Date: Fri, 29 May 2020 21:03:00 -0300 Subject: [PATCH] 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. --- src/comp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 } -- 2.39.5