From ea56b58098d78b242bc0c51cf1d8b1d21962c130 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Mon, 3 Feb 2020 21:12:03 +0000 Subject: [PATCH] Add assertion in load_comp_unit While resurrecting from an image dump loading more than once the same compilation unit does not make any sense. --- src/comp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/comp.c b/src/comp.c index ebe7b8b9a9a..03b320bf5f4 100644 --- a/src/comp.c +++ b/src/comp.c @@ -3300,6 +3300,10 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump) xsignal1 (Qnative_lisp_file_inconsistent, comp_u->file); bool reloading_cu = *saved_cu ? true : false; + /* While resurrecting from an image dump loading more than once the + same compilation unit does not make any sense. */ + eassert (!(loading_dump && reloading_cu)); + if (reloading_cu) /* 'dlopen' returns the same handle when trying to load two times the same shared. In this case touching 'd_reloc' etc leads to -- 2.39.5