]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix crash when evaluating "(signal nil 5)" (bug#78738)
authorPip Cet <pipcet@protonmail.com>
Tue, 10 Jun 2025 12:00:30 +0000 (12:00 +0000)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:02:53 +0000 (10:02 +0200)
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.

(cherry picked from commit 888f846d377a589c6fca5be5d2f4274f423e5fcf)

src/eval.c

index f447b5e955140adcf08b63072f77cf20aa7a7a0c..0ad26c4386712e833a6e7b79705305b9c0ac98ca 100644 (file)
@@ -1888,7 +1888,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);