summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-07-27 22:06:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-07-27 22:06:34 -0700
commit95b77ddddc32115d185b84e4a4ec896de5bc398d (patch)
tree90e045aaa1d9d786284d0c4274c9029fcedfb7d4
parent718718b657cc07dab9b3f3e74106b4ba4d0dadaf (diff)
downloadtxr-95b77ddddc32115d185b84e4a4ec896de5bc398d.tar.gz
txr-95b77ddddc32115d185b84e4a4ec896de5bc398d.tar.bz2
txr-95b77ddddc32115d185b84e4a4ec896de5bc398d.zip
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.
-rw-r--r--stdlib/place.tl2
1 files changed, 2 insertions, 0 deletions
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)