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
commit448177d2b7e54aeda8d825b1ab2cce260e9261ef (patch)
tree90e045aaa1d9d786284d0c4274c9029fcedfb7d4
parent8034e6f34b330c0ebb5b3a6c790b06fb3a8d50c7 (diff)
downloadtxr-448177d2b7e54aeda8d825b1ab2cce260e9261ef.tar.gz
txr-448177d2b7e54aeda8d825b1ab2cce260e9261ef.tar.bz2
txr-448177d2b7e54aeda8d825b1ab2cce260e9261ef.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)