emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 52abeaf1333: * src/lread.c (build_load_history): Be careful with


From: Stefan Monnier
Subject: master 52abeaf1333: * src/lread.c (build_load_history): Be careful with in-place updates
Date: Sun, 4 Feb 2024 12:59:07 -0500 (EST)

branch: master
commit 52abeaf1333427f156a23f0acf057e81bcc5e9e2
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * src/lread.c (build_load_history): Be careful with in-place updates
    
    Don't leave a "broken" value in `Vcurrent_load_list`.
---
 src/lread.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]