[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp bb9c018 1/2: Do not call `gensym' too early when loa
From: |
Andrea Corallo |
Subject: |
feature/native-comp bb9c018 1/2: Do not call `gensym' too early when loading a dump file. |
Date: |
Sun, 31 May 2020 04:53:53 -0400 (EDT) |
branch: feature/native-comp
commit bb9c0188ea3881a555415de7e6fe7973911719e9
Author: Nicolás Bértolo <nicolasbertolo@gmail.com>
Commit: Andrea Corallo <akrl@sdf.org>
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 32a9817..d3bff1e 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
}