summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2017-05-27 14:39:01 +0200
committerPhilipp Stephani <phst@google.com>2017-05-27 15:30:19 +0200
commitebe0bdae9ded4eab974faefb54a6ba5260523489 (patch)
treed63f9db7cbfdab4b21d66b6c1c55aa565b31e326 /lisp/emacs-lisp/bytecomp.el
parenta3a3ea0762d0e5d3b2cb8259a515a468736050d1 (diff)
downloademacs-ebe0bdae9ded4eab974faefb54a6ba5260523489.tar.gz
emacs-ebe0bdae9ded4eab974faefb54a6ba5260523489.tar.bz2
emacs-ebe0bdae9ded4eab974faefb54a6ba5260523489.zip
Don't attempt to recover from undefined behavior in some cases
These functions can only be run in batch mode and exit Emacs on return, so nothing can be recovered. Disable unsafe recover mechanisms so that we get real failures and good stack traces on fatal signals. * lisp/emacs-lisp/bytecomp.el (batch-byte-compile) (batch-byte-recompile-directory): * lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit) (ert-summarize-tests-batch-and-exit): Don't attempt to recover from undefined behavior.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 6c12e5d8e25..12a7d4afc2a 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -4960,6 +4960,10 @@ already up-to-date."
(defvar command-line-args-left) ;Avoid 'free variable' warning
(if (not noninteractive)
(error "`batch-byte-compile' is to be used only with -batch"))
+ ;; Better crash loudly than attempting to recover from undefined
+ ;; behavior.
+ (setq attempt-stack-overflow-recovery nil
+ attempt-orderly-shutdown-on-fatal-signal nil)
(let ((error nil))
(while command-line-args-left
(if (file-directory-p (expand-file-name (car command-line-args-left)))
@@ -5052,6 +5056,10 @@ and corresponding effects."
(defvar command-line-args-left) ;Avoid 'free variable' warning
(if (not noninteractive)
(error "batch-byte-recompile-directory is to be used only with -batch"))
+ ;; Better crash loudly than attempting to recover from undefined
+ ;; behavior.
+ (setq attempt-stack-overflow-recovery nil
+ attempt-orderly-shutdown-on-fatal-signal nil)
(or command-line-args-left
(setq command-line-args-left '(".")))
(while command-line-args-left