Make sure that a record's type name is an immutable string.
authorChris Hanson <org/chris-hanson/cph>
Sun, 7 Jan 2018 20:36:18 +0000 (15:36 -0500)
committerChris Hanson <org/chris-hanson/cph>
Sun, 7 Jan 2018 20:36:18 +0000 (15:36 -0500)
src/runtime/record.scm

index 932d4e521b4a59e7d23197ee61494251972eb392..2093dc393166bdfaf7275b9ed8e2fc3b18f5c145 100644 (file)
@@ -175,7 +175,7 @@ USA.
 
 (define (record-type-name record-type)
   (guarantee-record-type record-type 'RECORD-TYPE-NAME)
-  (string-copy (%record-type-name record-type)))
+  (%record-type-name record-type))
 
 (define (record-type-field-names record-type)
   (guarantee-record-type record-type 'RECORD-TYPE-FIELD-NAMES)
@@ -488,7 +488,7 @@ USA.
                                        error?))))))
 
 (define (->type-name object)
-  (cond ((string? object) object)
+  (cond ((string? object) (string->immutable object))
        ((symbol? object) (symbol->string object))
        (else (error:wrong-type-argument object "type name" #f))))