summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-08-16 14:07:24 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-08-16 14:07:24 +0200
commit5bf26de995b9935dde5cce73c1a2d37337f3f53a (patch)
tree83d20b4e7325d1e89df10a1a3a8482a3c1f56337
parentbe97d617f75006ed96aebb6416d3281eca5c5ad2 (diff)
Prevent some misguided access of a prefix's value slot
Initializing a prefix sets its `value' slot. Initializing the `value' slots of its suffixes involves accessing the value stored in that slot. After that the values of the suffixes' `value' slot collectively specify the prefix's value. The value of the prefix's `value' slot may or may not be identical at this point. (For example a suffix's `init-value' slot may set pick a value different from the value in the prefix's `value' slot.) To prevent access to the potentially outdated value of the prefix's `value' slot, make it unbound after initializing the suffixes.
-rw-r--r--lisp/transient.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/transient.el b/lisp/transient.el
index 5b76656..a4d52ad 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2462,7 +2462,8 @@ value. Otherwise return CHILDREN as is.")
(t
(setq transient--suffixes nil)
(setq transient--layout (transient--init-suffixes name))
- (setq transient--suffixes (nreverse transient--suffixes)))))
+ (setq transient--suffixes (nreverse transient--suffixes))))
+ (slot-makeunbound transient--prefix 'value))
(defun transient--init-prefix (name &optional params)
(let ((obj (let ((proto (get name 'transient--prefix)))