From 2ff5cb4cb4420e2b18ea8451ad0b29f1a69bdb6c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 24 Jun 2022 10:45:34 +0200 Subject: [PATCH] Make warning about require/autoload while bootstrapping not error out * src/fns.c (Frequire): * src/eval.c (Fautoload_do_load): Avoid further errors while outputting the error about not being able to autoload/require while bootstrapping. --- src/eval.c | 9 +++++++-- src/fns.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/eval.c b/src/eval.c index 346dff8bdcc..141d2546f08 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2273,8 +2273,13 @@ it defines a macro. */) /* This is to make sure that loadup.el gives a clear picture of what files are preloaded and when. */ if (will_dump_p () && !will_bootstrap_p ()) - error ("Attempt to autoload %s while preparing to dump", - SDATA (SYMBOL_NAME (funname))); + { + /* Avoid landing here recursively while outputting the + backtrace from the error. */ + gflags.will_dump_ = false; + error ("Attempt to autoload %s while preparing to dump", + SDATA (SYMBOL_NAME (funname))); + } CHECK_SYMBOL (funname); diff --git a/src/fns.c b/src/fns.c index 4a9954ce903..5ee8482d003 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3121,8 +3121,13 @@ FILENAME are suppressed. */) /* This is to make sure that loadup.el gives a clear picture of what files are preloaded and when. */ if (will_dump_p () && !will_bootstrap_p ()) - error ("(require %s) while preparing to dump", - SDATA (SYMBOL_NAME (feature))); + { + /* Avoid landing here recursively while outputting the + backtrace from the error. */ + gflags.will_dump_ = false; + error ("(require %s) while preparing to dump", + SDATA (SYMBOL_NAME (feature))); + } /* A certain amount of recursive `require' is legitimate, but if we require the same feature recursively 3 times, -- 2.39.2