aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2018-10-07 17:45:12 +0300
committerEli Zaretskii2018-10-07 17:45:12 +0300
commit14c032d5f8d4ccb608cc906db34ddf17ce465449 (patch)
treee9b21fc078131069249aa6129c718c412c483070 /src
parentb99192fe24fc5dd75340083403e95a65cb4a6d79 (diff)
downloademacs-14c032d5f8d4ccb608cc906db34ddf17ce465449.tar.gz
emacs-14c032d5f8d4ccb608cc906db34ddf17ce465449.zip
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)
Diffstat (limited to 'src')
-rw-r--r--src/eval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index f9563a3f80c..e90a9861a1a 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1503,7 +1503,7 @@ DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0,
1503This function does not return. 1503This function does not return.
1504 1504
1505An error symbol is a symbol with an `error-conditions' property 1505An error symbol is a symbol with an `error-conditions' property
1506that is a list of condition names. 1506that is a list of condition names. The symbol should be non-nil.
1507A handler for any of those names will get to handle this signal. 1507A handler for any of those names will get to handle this signal.
1508The symbol `error' should normally be one of them. 1508The symbol `error' should normally be one of them.
1509 1509
@@ -1515,6 +1515,9 @@ See also the function `condition-case'. */
1515 attributes: noreturn) 1515 attributes: noreturn)
1516 (Lisp_Object error_symbol, Lisp_Object data) 1516 (Lisp_Object error_symbol, Lisp_Object data)
1517{ 1517{
1518 /* If they call us with nonsensical arguments, produce "peculiar error". */
1519 if (NILP (error_symbol) && NILP (data))
1520 error_symbol = Qerror;
1518 signal_or_quit (error_symbol, data, false); 1521 signal_or_quit (error_symbol, data, false);
1519 eassume (false); 1522 eassume (false);
1520} 1523}