aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2021-03-05 10:45:09 +0100
committerAndrea Corallo2021-03-05 11:02:21 +0100
commit260617ddc2e8e46a741e6843f97c7ffbc5222ed0 (patch)
treee363d50e7d7d7fcfb6fd9e42736f430693242086 /src
parentb9ccbac7685620d4624f55b9de361c610ede8aa4 (diff)
downloademacs-260617ddc2e8e46a741e6843f97c7ffbc5222ed0.tar.gz
emacs-260617ddc2e8e46a741e6843f97c7ffbc5222ed0.zip
* Harden `comp-abi-hash' computation
Account for subr arity in `comp-abi-hash' computation as that's part of the ABI exposed to .eln files. * src/comp.c (Fcomp__subr_signature): New support function. (hash_native_abi): Make use of. (syms_of_comp): Register 'Scomp__subr_signature'.
Diffstat (limited to 'src')
-rw-r--r--src/comp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/comp.c b/src/comp.c
index 1e50b4fe8f7..17dc4cbc132 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -713,6 +713,16 @@ comp_hash_source_file (Lisp_Object filename)
713 return Fsubstring (digest, Qnil, make_fixnum (HASH_LENGTH)); 713 return Fsubstring (digest, Qnil, make_fixnum (HASH_LENGTH));
714} 714}
715 715
716DEFUN ("comp--subr-signature", Fcomp__subr_signature,
717 Scomp__subr_signature, 1, 1, 0,
718 doc: /* Support function to 'hash_native_abi'.
719For internal use. */)
720 (Lisp_Object subr)
721{
722 return concat2 (Fsubr_name (subr),
723 Fprin1_to_string (Fsubr_arity (subr), Qnil));
724}
725
716/* Produce a key hashing Vcomp_subr_list. */ 726/* Produce a key hashing Vcomp_subr_list. */
717 727
718void 728void
@@ -726,7 +736,7 @@ hash_native_abi (void)
726 concat3 (build_string (ABI_VERSION), 736 concat3 (build_string (ABI_VERSION),
727 concat3 (Vemacs_version, Vsystem_configuration, 737 concat3 (Vemacs_version, Vsystem_configuration,
728 Vsystem_configuration_options), 738 Vsystem_configuration_options),
729 Fmapconcat (intern_c_string ("subr-name"), 739 Fmapconcat (intern_c_string ("comp--subr-signature"),
730 Vcomp_subr_list, build_string ("")))); 740 Vcomp_subr_list, build_string (""))));
731 Vcomp_native_version_dir = 741 Vcomp_native_version_dir =
732 concat3 (Vemacs_version, build_string ("-"), Vcomp_abi_hash); 742 concat3 (Vemacs_version, build_string ("-"), Vcomp_abi_hash);
@@ -5199,6 +5209,7 @@ compiled one. */);
5199 build_pure_c_string ("eln file inconsistent with current runtime " 5209 build_pure_c_string ("eln file inconsistent with current runtime "
5200 "configuration, please recompile")); 5210 "configuration, please recompile"));
5201 5211
5212 defsubr (&Scomp__subr_signature);
5202 defsubr (&Scomp_el_to_eln_filename); 5213 defsubr (&Scomp_el_to_eln_filename);
5203 defsubr (&Scomp_native_driver_options_effective_p); 5214 defsubr (&Scomp_native_driver_options_effective_p);
5204 defsubr (&Scomp__install_trampoline); 5215 defsubr (&Scomp__install_trampoline);