[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 7f85127 1/4: * Setup correctly the printer while dum
From: |
Andrea Corallo |
Subject: |
feature/native-comp 7f85127 1/4: * Setup correctly the printer while dumping objs in native CU (bug#42088) |
Date: |
Sun, 28 Jun 2020 10:55:33 -0400 (EDT) |
branch: feature/native-comp
commit 7f8512765a50858d51805762e88d291fc31b3490
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
* 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.
---
src/comp.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/comp.c b/src/comp.c
index 6909aef..bb416ec 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);