From: Andrea Corallo Date: Sun, 17 Nov 2019 13:17:59 +0000 (+0100) Subject: remove old eln before creating a new one to prevent crashes X-Git-Tag: emacs-28.0.90~2727^2~981 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6a546e63d0134861b208ab1bac259f71fcb30b83;p=emacs.git remove old eln before creating a new one to prevent crashes --- 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, gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c"); AUTO_STRING (dot_so, NATIVE_ELISP_SUFFIX); + Lisp_Object out_file = CALLN (Fconcat, ctxtname, dot_so); + /* Remove the old eln before creating the new one to get a new inode and + prevent crashes in case the old one is currently loaded. */ + if (!NILP (Ffile_exists_p (out_file))) + Fdelete_file (out_file, Qnil); + gcc_jit_context_compile_to_file (comp.ctxt, GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, SSDATA (out_file));