From 95b77ddddc32115d185b84e4a4ec896de5bc398d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 27 Jul 2023 22:06:34 -0700 Subject: symbol-function: check symbol argument. * stdlib/place.tl (sys:get-fun-setter-getter): Throw error if sym isn't a bindable symbol, so that nonsense like (set (symbol-function 3) ...) isn't allowed. --- stdlib/place.tl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/place.tl b/stdlib/place.tl index b7437de2..bcf54ccc 100644 --- a/stdlib/place.tl +++ b/stdlib/place.tl @@ -800,6 +800,8 @@ ,body))) (defun sys:get-fun-getter-setter (sym : f) + (unless (bindable sym) + (compile-error f "~s isn't a bindable symbol" sym)) (tree-case sym ((type struct slot) (if (eq type 'meth) -- cgit v1.2.3