From 291085a2a61d7596e6f3e3152247198fdf85da26 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 31 Dec 2021 00:16:03 -0500 Subject: [PATCH] (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 16f9076b03c..d82af1980a3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3888,6 +3888,7 @@ count as reachable for the purpose of deciding whether to run 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 ddf455e4d78..83ec3eab112 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); } -- 2.39.2