fix bug in hashing shortcut for transparency

This commit is contained in:
Matthew Flatt 2013-02-28 10:03:41 -07:00
parent 9e93ee2682
commit 2236363696
2 changed files with 11 additions and 1 deletions

View File

@ -2562,6 +2562,16 @@
(equal-hash-code ht)
(equal-secondary-hash-code ht))
;; Check that an equal hash code on an
;; mutable, opaque structure does not
;; see mutation.
(let ()
(struct a (x [y #:mutable]))
(define an-a (a 1 2))
(define v (equal-hash-code an-a))
(set-a-y! an-a 8)
(test v equal-hash-code an-a))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Misc

View File

@ -3061,7 +3061,7 @@ int scheme_struct_is_transparent(Scheme_Object *s)
stype = ((Scheme_Structure *)s)->stype;
for (p = stype->name_pos; p--; ) {
for (p = stype->name_pos + 1; p--; ) {
if (SCHEME_TRUEP(stype->parent_types[p]->inspector))
return 0;
}