[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 291085a2a6: (Fmake_finalizer): Check the arg is a function

From: Stefan Monnier
Subject: master 291085a2a6: (Fmake_finalizer): Check the arg is a function
Date: Fri, 31 Dec 2021 00:16:12 -0500 (EST)

branch: master
commit 291085a2a61d7596e6f3e3152247198fdf85da26
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    (Fmake_finalizer): Check the arg is a function
    * src/eval.c (syms_of_eval): Add `Qfunctionp`.
    * src/alloc.c (Fmake_finalizer): Check the arg is a function.
 src/alloc.c | 1 +
 src/eval.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/alloc.c b/src/alloc.c
index 16f9076b03..d82af1980a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3888,6 +3888,7 @@ count as reachable for the purpose of deciding whether to 
 FUNCTION.  FUNCTION will be run once per finalizer object.  */)
   (Lisp_Object function)
+  CHECK_TYPE (FUNCTIONP (function), Qfunctionp, function);
   struct Lisp_Finalizer *finalizer
     = ALLOCATE_PSEUDOVECTOR (struct Lisp_Finalizer, function, PVEC_FINALIZER);
   finalizer->function = function;
diff --git a/src/eval.c b/src/eval.c
index ddf455e4d7..83ec3eab11 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -4594,5 +4594,6 @@ alist of active lexical bindings.  */);
   defsubr (&Sbacktrace_eval);
   defsubr (&Sbacktrace__locals);
   defsubr (&Sspecial_variable_p);
+  DEFSYM (Qfunctionp, "functionp");
   defsubr (&Sfunctionp);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]