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,