From: Stefan Monnier Date: Sun, 4 Feb 2024 17:58:56 +0000 (-0500) Subject: * src/lread.c (build_load_history): Be careful with in-place updates X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=824abdf95d3805f6b983cf1a66ae4d624f3cc77c;p=emacs.git * src/lread.c (build_load_history): Be careful with in-place updates Don't leave a "broken" value in `Vcurrent_load_list`. (cherry picked from commit 52abeaf1333427f156a23f0acf057e81bcc5e9e2) --- diff --git a/src/lread.c b/src/lread.c index cc55b009ab9..b1b109315f9 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2369,8 +2369,14 @@ build_load_history (Lisp_Object filename, bool entire) front of load-history, the most-recently-loaded position. Also do this if we didn't find an existing member for the file. */ if (entire || !foundit) - Vload_history = Fcons (Fnreverse (Vcurrent_load_list), - Vload_history); + { + Lisp_Object tem = Fnreverse (Vcurrent_load_list); + eassert (EQ (filename, Fcar (tem))); + Vload_history = Fcons (tem, Vload_history); + /* FIXME: There should be an unbind_to right after calling us which + should re-establish the previous value of Vcurrent_load_list. */ + Vcurrent_load_list = Qt; + } } static void