Fix bug in struct-wrap signature checking.

Only check the fields if we know the struct type is right.
This commit is contained in:
Mike Sperber 2011-01-06 13:53:51 +01:00
parent 7cac1f6ac2
commit 69963a1f2c

View File

@ -484,9 +484,9 @@
(make-signature (make-signature
name name
(lambda (self thing) (lambda (self thing)
(if (not (predicate thing)) (if (not (predicate thing))
(signature-violation thing self #f #f) (signature-violation thing self #f #f)
(begin
(let ((log (wrap-ref thing))) (let ((log (wrap-ref thing)))
(cond (cond
((not log) ((not log)
@ -506,10 +506,10 @@
(ormap check (lazy-wrap-log-checked log))))) (ormap check (lazy-wrap-log-checked log)))))
(wrap-set! thing (wrap-set! thing
(make-lazy-wrap-log (cons not-checked (lazy-wrap-log-not-checked log)) (make-lazy-wrap-log (cons not-checked (lazy-wrap-log-not-checked log))
(lazy-wrap-log-checked log))))))) (lazy-wrap-log-checked log))))))
(when eager-checking? (when eager-checking?
(check-lazy-wraps! type-descriptor thing)) (check-lazy-wraps! type-descriptor thing))))
thing) thing)
(delay syntax) (delay syntax)