[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 14c032d: Avoid assertion violations in nonsensica
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-26 14c032d: Avoid assertion violations in nonsensical calls to 'signal' |
Date: |
Sun, 7 Oct 2018 10:46:17 -0400 (EDT) |
branch: emacs-26
commit 14c032d5f8d4ccb608cc906db34ddf17ce465449
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Avoid assertion violations in nonsensical calls to 'signal'
* src/eval.c (Fsignal): If both arguments are nil, replace the
first one with 'error', to avoid assertion violations further
down the line. (Bug#32961)
---
src/eval.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/eval.c b/src/eval.c
index f9563a3..e90a986 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1503,7 +1503,7 @@ DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
This function does not return.
An error symbol is a symbol with an `error-conditions' property
-that is a list of condition names.
+that is a list of condition names. The symbol should be non-nil.
A handler for any of those names will get to handle this signal.
The symbol `error' should normally be one of them.
@@ -1515,6 +1515,9 @@ See also the function `condition-case'. */
attributes: noreturn)
(Lisp_Object error_symbol, Lisp_Object data)
{
+ /* If they call us with nonsensical arguments, produce "peculiar error". */
+ if (NILP (error_symbol) && NILP (data))
+ error_symbol = Qerror;
signal_or_quit (error_symbol, data, false);
eassume (false);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 14c032d: Avoid assertion violations in nonsensical calls to 'signal',
Eli Zaretskii <=