[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/08: Fix bootstrap slot permissions for <class>
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/08: Fix bootstrap slot permissions for <class> |
Date: |
Sat, 23 Sep 2017 09:57:02 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 0f14a9e59826c1c304d1f50c741e91d99760ff43
Author: Andy Wingo <address@hidden>
Date: Sat Sep 23 15:15:18 2017 +0200
Fix bootstrap slot permissions for <class>
* module/oop/goops.scm: Fix bootstrap slot computation to preserve slot
permissions.
---
module/oop/goops.scm | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index 78bbc4b..39bff06 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -932,13 +932,23 @@ slots as we go."
;; Boot definition that avoids munging nfields.
(define (allocate-slots class slots)
(define (make-effective-slot-definition slot index)
- (let* ((slot (compute-effective-slot-definition class slot)))
+ (let* ((slot (compute-effective-slot-definition class slot))
+ (get/raw (standard-get index))
+ (set/raw (standard-set index)))
(struct-set! slot slot-index-slot-ref/raw (standard-get index))
(struct-set! slot slot-index-slot-ref
(if (slot-definition-init-thunk slot)
- (struct-ref slot slot-index-slot-ref/raw)
+ get/raw
(bound-check-get index)))
- (struct-set! slot slot-index-slot-set! (standard-set index))
+ (struct-set! slot slot-index-slot-set!
+ (if (read-only-slot? slot)
+ (lambda (o v)
+ (let ((v* (get/raw o)))
+ (if (unbound? v*)
+ ;; Allow initialization.
+ (set/raw o v)
+ (error "Slot is read-only" slot))))
+ set/raw))
(struct-set! slot slot-index-index index)
(struct-set! slot slot-index-size 1)
slot))
- [Guile-commits] branch master updated (7f61d5f -> 9211981), Andy Wingo, 2017/09/23
- [Guile-commits] 01/08: Merge from stable-2.2, Andy Wingo, 2017/09/23
- [Guile-commits] 02/08: Remove <int-slot>, <float-slot>, <double-slot>, Andy Wingo, 2017/09/23
- [Guile-commits] 03/08: Merge 'stable-2.2', Andy Wingo, 2017/09/23
- [Guile-commits] 06/08: Fix bootstrap slot permissions for <class>,
Andy Wingo <=
- [Guile-commits] 05/08: Remove opaque slots, Andy Wingo, 2017/09/23
- [Guile-commits] 08/08: Inline struct-ref etc definitions in the VM., Andy Wingo, 2017/09/23
- [Guile-commits] 07/08: Replace "pr" struct fields with "pw" fields, Andy Wingo, 2017/09/23
- [Guile-commits] 04/08: Merge 'stable-2.2', Andy Wingo, 2017/09/23