fix 0-field prefab immutability flag

Closes PR 11777
This commit is contained in:
Matthew Flatt 2011-02-28 15:19:20 -07:00
parent 95b5c49b9b
commit 733eab5805
2 changed files with 4 additions and 1 deletions

View File

@ -1052,6 +1052,7 @@
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Prefab
(test #t struct? (readstr "#s(v)"))
(test #t struct? (readstr "#s(v 1)"))
(test #t struct? (readstr "#s((v 1) 1)"))
(test #t struct? (readstr "#s((v 1 #()) 1)"))
@ -1078,6 +1079,8 @@
(and (exn:fail:read? x)
(not (exn:fail:read:eof? x)))))
(test #t struct? (syntax-e (read-syntax 'string (open-input-string "#s(v)"))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; read-language

View File

@ -3929,7 +3929,7 @@ static void struct_type_set_if_immutable(Scheme_Struct_Type *struct_type) {
size = struct_type->num_islots;
if (struct_type->name_pos)
size -= struct_type->parent_types[struct_type->name_pos - 1]->num_islots;
if (struct_type->immutables) {
if (!size || struct_type->immutables) {
for (i = 0; i < size; i++) {
if (!struct_type->immutables[i])
return;