diff options
| author | Andrea Corallo | 2024-12-18 21:27:14 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2024-12-18 23:15:58 +0100 |
| commit | 4e11f9c96df98dd3f10c1153bc49209f2383a0ee (patch) | |
| tree | 4515b53faa48a2fbaee288b7d062a9d3e0c282ff /src | |
| parent | 81fc23b5d6a60ca4f3d269ab2c88eb9a850bac4c (diff) | |
| download | emacs-4e11f9c96df98dd3f10c1153bc49209f2383a0ee.tar.gz emacs-4e11f9c96df98dd3f10c1153bc49209f2383a0ee.zip | |
* Revert "Remove check_comp_unit_relocs"
This reverts commit 81fc23b5d6a60ca4f3d269ab2c88eb9a850bac4c as the
check is still useful but needs to be updated for the new reloc layout.
* src/comp.c (check_comp_unit_relocs): Re-add.
(load_comp_unit): Make use of.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/comp.c b/src/comp.c index aa24f61ac87..ac26ead08d9 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -5160,6 +5160,32 @@ load_static_obj (struct Lisp_Native_Comp_Unit *comp_u, const char *name) | |||
| 5160 | 5160 | ||
| 5161 | } | 5161 | } |
| 5162 | 5162 | ||
| 5163 | /* Return false when something is wrong or true otherwise. */ | ||
| 5164 | |||
| 5165 | static bool | ||
| 5166 | check_comp_unit_relocs (struct Lisp_Native_Comp_Unit *comp_u) | ||
| 5167 | { | ||
| 5168 | dynlib_handle_ptr handle = comp_u->handle; | ||
| 5169 | Lisp_Object *data_relocs = dynlib_sym (handle, DATA_RELOC_SYM); | ||
| 5170 | |||
| 5171 | EMACS_INT d_vec_len = XFIXNUM (Flength (comp_u->data_vec)); | ||
| 5172 | |||
| 5173 | for (ptrdiff_t i = 0; i < d_vec_len; i++) | ||
| 5174 | { | ||
| 5175 | Lisp_Object x = data_relocs[i]; | ||
| 5176 | if (EQ (x, Qlambda_fixup)) | ||
| 5177 | return false; | ||
| 5178 | else if (NATIVE_COMP_FUNCTIONP (x)) | ||
| 5179 | { | ||
| 5180 | if (NILP (Fgethash (x, comp_u->lambda_gc_guard_h, Qnil))) | ||
| 5181 | return false; | ||
| 5182 | } | ||
| 5183 | else if (!EQ (x, AREF (comp_u->data_vec, i))) | ||
| 5184 | return false; | ||
| 5185 | } | ||
| 5186 | return true; | ||
| 5187 | } | ||
| 5188 | |||
| 5163 | static void | 5189 | static void |
| 5164 | unset_cu_load_ongoing (Lisp_Object comp_u) | 5190 | unset_cu_load_ongoing (Lisp_Object comp_u) |
| 5165 | { | 5191 | { |
| @@ -5289,6 +5315,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump, | |||
| 5289 | /* Make sure data_ephemeral_vec still exists after top_level_run has run. | 5315 | /* Make sure data_ephemeral_vec still exists after top_level_run has run. |
| 5290 | Guard against sibling call optimization (or any other). */ | 5316 | Guard against sibling call optimization (or any other). */ |
| 5291 | data_ephemeral_vec = data_ephemeral_vec; | 5317 | data_ephemeral_vec = data_ephemeral_vec; |
| 5318 | eassert (check_comp_unit_relocs (comp_u)); | ||
| 5292 | } | 5319 | } |
| 5293 | 5320 | ||
| 5294 | if (!recursive_load) | 5321 | if (!recursive_load) |