diff options
| author | Eli Zaretskii | 2021-05-15 20:44:40 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-05-15 20:44:40 +0300 |
| commit | b5e6dba05fcb4fa1c716dc759f8c4b2561bacaa7 (patch) | |
| tree | 5fc6025d8adfe5cbf49439c7b7cf5fb7d2c8fcae /src | |
| parent | 46e4704e2abca4d264a43965f92eab7608211ee6 (diff) | |
| download | emacs-b5e6dba05fcb4fa1c716dc759f8c4b2561bacaa7.tar.gz emacs-b5e6dba05fcb4fa1c716dc759f8c4b2561bacaa7.zip | |
Fix segfaults when byte-compiling with native-compilation
* src/emacs.c (main): Call 'set_initial_minibuffer_mode' before
entering recursive-exit.
* src/minibuf.c (init_minibuf_once_for_pdumper): Don't call
'set_minibuffer_mode' here...
(set_initial_minibuffer_mode): ... set it in this new function.
(Bug#48446)
* src/lisp.h: Add prototype for 'set_initial_minibuffer_mode'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 1 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/minibuf.c | 12 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/emacs.c b/src/emacs.c index 9157cd84a99..60a57a693ce 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -2294,6 +2294,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 2294 | Vdump_mode = build_string (dump_mode); | 2294 | Vdump_mode = build_string (dump_mode); |
| 2295 | 2295 | ||
| 2296 | /* Enter editor command loop. This never returns. */ | 2296 | /* Enter editor command loop. This never returns. */ |
| 2297 | set_initial_minibuffer_mode (); | ||
| 2297 | Frecursive_edit (); | 2298 | Frecursive_edit (); |
| 2298 | eassume (false); | 2299 | eassume (false); |
| 2299 | } | 2300 | } |
diff --git a/src/lisp.h b/src/lisp.h index f83c55f827d..91b7a89d0f5 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4377,6 +4377,7 @@ extern EMACS_INT this_minibuffer_depth (Lisp_Object); | |||
| 4377 | extern EMACS_INT minibuf_level; | 4377 | extern EMACS_INT minibuf_level; |
| 4378 | extern Lisp_Object get_minibuffer (EMACS_INT); | 4378 | extern Lisp_Object get_minibuffer (EMACS_INT); |
| 4379 | extern void init_minibuf_once (void); | 4379 | extern void init_minibuf_once (void); |
| 4380 | extern void set_initial_minibuffer_mode (void); | ||
| 4380 | extern void syms_of_minibuf (void); | 4381 | extern void syms_of_minibuf (void); |
| 4381 | extern void barf_if_interaction_inhibited (void); | 4382 | extern void barf_if_interaction_inhibited (void); |
| 4382 | 4383 | ||
diff --git a/src/minibuf.c b/src/minibuf.c index b40d1fbafc8..cffb7fe787c 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -2271,6 +2271,13 @@ If no minibuffer is active, return nil. */) | |||
| 2271 | 2271 | ||
| 2272 | 2272 | ||
| 2273 | 2273 | ||
| 2274 | void | ||
| 2275 | set_initial_minibuffer_mode (void) | ||
| 2276 | { | ||
| 2277 | Lisp_Object minibuf = get_minibuffer (0); | ||
| 2278 | set_minibuffer_mode (minibuf, 0); | ||
| 2279 | } | ||
| 2280 | |||
| 2274 | static void init_minibuf_once_for_pdumper (void); | 2281 | static void init_minibuf_once_for_pdumper (void); |
| 2275 | 2282 | ||
| 2276 | void | 2283 | void |
| @@ -2279,6 +2286,8 @@ init_minibuf_once (void) | |||
| 2279 | staticpro (&Vminibuffer_list); | 2286 | staticpro (&Vminibuffer_list); |
| 2280 | staticpro (&Vcommand_loop_level_list); | 2287 | staticpro (&Vcommand_loop_level_list); |
| 2281 | pdumper_do_now_and_after_load (init_minibuf_once_for_pdumper); | 2288 | pdumper_do_now_and_after_load (init_minibuf_once_for_pdumper); |
| 2289 | /* Ensure our inactive minibuffer exists. */ | ||
| 2290 | get_minibuffer (0); | ||
| 2282 | } | 2291 | } |
| 2283 | 2292 | ||
| 2284 | static void | 2293 | static void |
| @@ -2296,9 +2305,6 @@ init_minibuf_once_for_pdumper (void) | |||
| 2296 | minibuf_prompt = Qnil; | 2305 | minibuf_prompt = Qnil; |
| 2297 | minibuf_save_list = Qnil; | 2306 | minibuf_save_list = Qnil; |
| 2298 | last_minibuf_string = Qnil; | 2307 | last_minibuf_string = Qnil; |
| 2299 | /* Ensure our inactive minibuffer exists. */ | ||
| 2300 | Lisp_Object minibuf = get_minibuffer (0); | ||
| 2301 | set_minibuffer_mode (minibuf, 0); | ||
| 2302 | } | 2308 | } |
| 2303 | 2309 | ||
| 2304 | void | 2310 | void |