aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPip Cet2025-01-18 20:55:18 +0000
committerPip Cet2025-01-18 20:55:18 +0000
commit2ecb34990a92d45ae2845244f4ccfc96ffe04829 (patch)
treeb924bc2fd058cbc93d5896821fb614e0c9294dfd /lisp
parentaa07e94439c663f768c32a689d14506d25a7a5bc (diff)
downloademacs-scratch/no-purespace.tar.gz
emacs-scratch/no-purespace.zip
Use #$ for lambda fixups in native compilation data vectorsscratch/no-purespace
The "#$" syntax is recognized by Fread, which substitutes Vload_file_name in its place. If Vload_file_name is bound appropriately, no other value can produce an object EQ to the one produced by "#$". We use this to check the data vector for entries that we know should have been initialized: if the value is still equal to what we bound Vload_file_name to when it was read, it wasn't initialized, and we abort. * lisp/emacs-lisp/comp.el (comp--#$): New defvar. (comp--finalize-container): Use it. * src/comp.c (ABI_VERSION): Bump. (emit_static_object): Ensure 'comp--#$' prints as "#$". (load_static_obj): Ensure '#$' reads as Vcomp__hashdollar. (check_comp_unit_relocs): Adjust assertion. (syms_of_comp): Define 'comp--#$'. * src/pdumper.c (dump_do_dump_relocation): Adjust assertion.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/comp.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index ab6fd77f11a..a8698ef6454 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -42,6 +42,7 @@
42(defvar comp-subr-arities-h) 42(defvar comp-subr-arities-h)
43(defvar native-comp-eln-load-path) 43(defvar native-comp-eln-load-path)
44(defvar native-comp-enable-subr-trampolines) 44(defvar native-comp-enable-subr-trampolines)
45(defvar comp--\#$)
45 46
46(declare-function comp--compile-ctxt-to-file0 "comp.c") 47(declare-function comp--compile-ctxt-to-file0 "comp.c")
47(declare-function comp--init-ctxt "comp.c") 48(declare-function comp--init-ctxt "comp.c")
@@ -3254,10 +3255,9 @@ Set it into the `type' slot."
3254 ;; from the corresponding m-var. 3255 ;; from the corresponding m-var.
3255 collect (if (gethash obj 3256 collect (if (gethash obj
3256 (comp-ctxt-byte-func-to-func-h comp-ctxt)) 3257 (comp-ctxt-byte-func-to-func-h comp-ctxt))
3257 ;; Hack not to have `--lambda-fixup' in 3258 ;; This prints as #$, so we can assert this
3258 ;; data relocations as it would trigger the 3259 ;; value does not remain in the data vector
3259 ;; check in 'check_comp_unit_relocs'. 3260 comp--\#$
3260 (intern (concat (make-string 1 ?-) "-lambda-fixup"))
3261 obj)))) 3261 obj))))
3262 3262
3263(defun comp--finalize-relocs () 3263(defun comp--finalize-relocs ()