From: Andrea Corallo Date: Sun, 28 Jun 2020 12:33:11 +0000 (+0100) Subject: * Setup correctly the printer while dumping objs in native CU (bug#42088) X-Git-Tag: emacs-28.0.90~2727^2~548 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7f8512765a50858d51805762e88d291fc31b3490;p=emacs.git * Setup correctly the printer while dumping objs in native CU (bug#42088) * src/comp.c (emit_static_object): Bind a bunch of special variables to setup `prin1-to-string' as `byte-compile-output-file-form' does. This to preserve uninterned symbols. --- diff --git a/src/comp.c b/src/comp.c index 6909aefda76..bb416ecb19a 100644 --- a/src/comp.c +++ b/src/comp.c @@ -2339,7 +2339,19 @@ emit_static_object (const char *name, Lisp_Object obj) strings cause of this funny bug that will affect all pre gcc10 era gccs: https://gcc.gnu.org/ml/jit/2019-q3/msg00013.html */ + ptrdiff_t count = SPECPDL_INDEX (); + /* Preserve uninterned symbols, this is specifically necessary for + CL macro expansion in dynamic scope code (bug#42088). See + `byte-compile-output-file-form'. */ + specbind (intern_c_string ("print-escape-newlines"), Qt); + specbind (intern_c_string ("print-length"), Qnil); + specbind (intern_c_string ("print-level"), Qnil); + specbind (intern_c_string ("print-quoted"), Qt); + specbind (intern_c_string ("print-gensym"), Qt); + specbind (intern_c_string ("print-circle"), Qt); Lisp_Object str = Fprin1_to_string (obj, Qnil); + unbind_to (count, Qnil); + ptrdiff_t len = SBYTES (str); const char *p = SSDATA (str);