[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 4784bcc 3/3: * Fix load logic for the reloading CU c
From: |
Andrea Corallo |
Subject: |
feature/native-comp 4784bcc 3/3: * Fix load logic for the reloading CU case (bug#41754) |
Date: |
Mon, 8 Jun 2020 17:24:20 -0400 (EDT) |
branch: feature/native-comp
commit 4784bcc96b32f2fc796c7067d2a6c8ddf00f4242
Author: Andrea Corallo <andcor03@e112547.nice.arm.com>
Commit: Andrea Corallo <akrl@sdf.org>
* Fix load logic for the reloading CU case (bug#41754)
* src/comp.c (load_comp_unit): When swapping the compilation unit
abandoning the new one for the original do not forget to set its
loaded_once field to true because is in use by
`comp--register-lambda'.
(Fcomp__register_lambda): Add sanity a check to spot
early if we are trying to load the same lambda twice.
---
src/comp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/comp.c b/src/comp.c
index b2dbfe8..960badb 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4439,6 +4439,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u,
bool loading_dump,
{
comp_u_lisp_obj = *saved_cu;
comp_u = XNATIVE_COMP_UNIT (comp_u_lisp_obj);
+ comp_u->loaded_once = true;
}
else
*saved_cu = comp_u_lisp_obj;
@@ -4603,6 +4604,7 @@ DEFUN ("comp--register-lambda", Fcomp__register_lambda,
Scomp__register_lambda,
Fputhash (tem, Qt, cu->lambda_gc_guard);
/* This is for fixing up the value in d_reloc while resurrecting
from dump. See 'dump_do_dump_relocation'. */
+ eassert (NILP (Fgethash (c_name, cu->lambda_c_name_idx_h, Qnil)));
Fputhash (c_name, reloc_idx, cu->lambda_c_name_idx_h);
/* The key is not really important as long is the same as
symbol_name so use c_name. */