]> git.eshelyaron.com Git - emacs.git/commitdiff
(loadhist_initialize): Fix regression test failure
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 20 Feb 2022 18:16:35 +0000 (13:16 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 20 Feb 2022 18:16:35 +0000 (13:16 -0500)
* src/lread.c (loadhist_initialize): Adjust assertion for the nil case.
(readevalloop): Signal an error for non-string `sourcename`.

src/lread.c

index d225403b2030195ec6cc736dfbf2b424453a649a..0486a98883c3a15d511a0ed4939e62e11ee01170 100644 (file)
@@ -1172,7 +1172,7 @@ compute_found_effective (Lisp_Object found)
 static void
 loadhist_initialize (Lisp_Object filename)
 {
-  eassert (STRINGP (filename));
+  eassert (STRINGP (filename) || NILP (filename));
   specbind (Qcurrent_load_list, Fcons (filename, Qnil));
 }
 
@@ -2179,6 +2179,9 @@ readevalloop (Lisp_Object readcharfun,
   bool first_sexp = 1;
   Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
 
+  if (!NILP (sourcename))
+    CHECK_STRING (sourcename);
+
   if (NILP (Ffboundp (macroexpand))
       || (STRINGP (sourcename) && suffix_p (sourcename, ".elc")))
     /* Don't macroexpand before the corresponding function is defined