Skip to content

Commit 4bde3b3

Browse files
authored
repair cross-compilation of ftype-scheme-object-pointer (#1038)
Checking whether a parent type represents a Scheme-object ftype pointer used an accessor technique that does not work for cross compilation. Also, repair a documentation typo and a technically too-weak check for consistent record definition.
1 parent 059ca75 commit 4bde3b3

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

csug/foreign.stex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ The resulting ftype pointer is recognized by
21512151
\scheme{ftype-pointer?} without an \var{ftype-name}.
21522152

21532153
If \var{ftype-name} is provided, it must be
2154-
\var{ftype-scheme-object-pointer} or a derived Scheme-object pointer
2154+
\scheme{ftype-scheme-object-pointer} or a derived Scheme-object pointer
21552155
type that is defined using \scheme{define-ftype}.
21562156

21572157
%----------------------------------------------------------------------------

s/ftype.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ ftype operators:
287287
(define ftd-stype (record-accessor rtd/ftd 0))
288288
(define ftd-size (record-accessor rtd/ftd 1))
289289
(define ftd-alignment (record-accessor rtd/ftd 2))
290-
(define rtd-pm (lambda (x) ($object-ref 'scheme-object x (constant record-type-pm-disp))))
290+
(define rtd-pm (csv7:record-field-accessor #!base-rtd 'pm))
291291
(define-syntax define-ftd-record-type
292292
(lambda (x)
293293
(define construct-name

s/record.ss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,7 @@
640640
(unless (eq? ($record-type-descriptor rtd) base-rtd) (squawk "different base rtd"))
641641
(unless (eq? (rtd-parent rtd) parent) (squawk "different parent"))
642642
(unless (same-fields? (rtd-flds rtd) (if (pair? flds) (cdr flds) (fx- flds 1))) (squawk "different fields"))
643-
(let ([pm (rtd-pm rtd)])
644-
(unless (if alt-pm (eq? pm alt-pm) (or (fixnum? pm) (bignum? pm)))
645-
(squawk "different pointer mask")))
643+
(unless (eqv? (rtd-pm rtd) (or alt-pm pm)) (squawk "different pointer mask"))
646644
(unless (= (rtd-mpm rtd) mpm) (squawk "different mutability"))
647645
(unless (fx= (rtd-flags rtd) flags) (squawk "different flags"))
648646
(unless (eq? (rtd-size rtd) size) (squawk "different size"))

0 commit comments

Comments
 (0)