1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Fix crash when evaluating "(signal nil 5)" (bug#78738)

The docstring already warns against calling signal with a nil
error symbol, which is for internal use only, but we can avoid crashing
in this case.

* src/eval.c (Fsignal): Produce a "peculiar error" for more arguments
involving non-lists.
This commit is contained in:
Pip Cet 2025-06-10 12:00:30 +00:00
parent 51b9e92ab8
commit 888f846d37

View file

@ -1817,7 +1817,7 @@ See also the function `condition-case'. */
(Lisp_Object error_symbol, Lisp_Object data)
{
/* If they call us with nonsensical arguments, produce "peculiar error". */
if (NILP (error_symbol) && NILP (data))
if (NILP (error_symbol) && !CONSP (data))
error_symbol = Qerror;
signal_or_quit (error_symbol, data, false);
eassume (false);