]> git.eshelyaron.com Git - emacs.git/commit
Use #$ for lambda fixups in native compilation data vectors
authorPip Cet <pipcet@protonmail.com>
Sat, 18 Jan 2025 20:55:18 +0000 (20:55 +0000)
committerEshel Yaron <me@eshelyaron.com>
Mon, 3 Feb 2025 11:13:49 +0000 (12:13 +0100)
commit95fe14eaff936bdeb365369324e37cc97dd376cf
tree7bc33a8b7ae391207dc8ebfd6ed0ead4acb359a6
parent74408177790d75cfa78731adf5cf96006227fb59
Use #$ for lambda fixups in native compilation data vectors

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.

(cherry picked from commit 4eabfd68c91185909be307435e5db8b8f0fb4102)
lisp/emacs-lisp/comp.el
src/comp.c
src/pdumper.c