diff options
| author | Andrea Corallo | 2019-11-17 14:17:59 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:38:06 +0100 |
| commit | 6a546e63d0134861b208ab1bac259f71fcb30b83 (patch) | |
| tree | 4298c79cb72d0932cea6155e3cccc1435528c979 /src/comp.c | |
| parent | f6b58e8016c7ce7b332a3b2a8a56bd2f9987d95a (diff) | |
| download | emacs-6a546e63d0134861b208ab1bac259f71fcb30b83.tar.gz emacs-6a546e63d0134861b208ab1bac259f71fcb30b83.zip | |
remove old eln before creating a new one to prevent crashes
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/comp.c b/src/comp.c index e5d703f769f..cbf38de29af 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -3078,8 +3078,14 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, | |||
| 3078 | gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c"); | 3078 | gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c"); |
| 3079 | 3079 | ||
| 3080 | AUTO_STRING (dot_so, NATIVE_ELISP_SUFFIX); | 3080 | AUTO_STRING (dot_so, NATIVE_ELISP_SUFFIX); |
| 3081 | |||
| 3081 | Lisp_Object out_file = CALLN (Fconcat, ctxtname, dot_so); | 3082 | Lisp_Object out_file = CALLN (Fconcat, ctxtname, dot_so); |
| 3082 | 3083 | ||
| 3084 | /* Remove the old eln before creating the new one to get a new inode and | ||
| 3085 | prevent crashes in case the old one is currently loaded. */ | ||
| 3086 | if (!NILP (Ffile_exists_p (out_file))) | ||
| 3087 | Fdelete_file (out_file, Qnil); | ||
| 3088 | |||
| 3083 | gcc_jit_context_compile_to_file (comp.ctxt, | 3089 | gcc_jit_context_compile_to_file (comp.ctxt, |
| 3084 | GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, | 3090 | GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, |
| 3085 | SSDATA (out_file)); | 3091 | SSDATA (out_file)); |