Chez Scheme: fix intern of some symbols on startup

Closes #3399
This commit is contained in:
Matthew Flatt 2020-09-15 15:17:57 -06:00
parent cb723ad4c8
commit c1f62ae959
2 changed files with 6 additions and 2 deletions

View File

@ -475,6 +475,7 @@
(test #f eq? (symbol->string 'apple) (symbol->string 'apple))
(test "apple" symbol->immutable-string 'apple)
(test #t immutable? (symbol->immutable-string 'apple))
(test #t immutable? (symbol->immutable-string 'box))
#ci(test #t eq? 'mISSISSIppi 'mississippi)
#ci(test #f 'string->symbol (eq? 'bitBlt (string->symbol "bitBlt")))

View File

@ -153,7 +153,7 @@ ptr S_intern(const unsigned char *s) {
iptr n = strlen((const char *)s);
iptr hc = hash(s, n);
iptr idx = OBINDEX(hc, S_G.oblist_length);
ptr sym;
ptr sym, str;
bucket *b;
tc_mutex_acquire();
@ -177,7 +177,10 @@ ptr S_intern(const unsigned char *s) {
b = b->next;
}
sym = S_symbol(S_string((const char *)s, n));
str = S_string((const char *)s, n);
STRTYPE(str) |= string_immutable_flag;
sym = S_symbol(str);
INITSYMHASH(sym) = FIX(hc);
oblist_insert(sym, idx, 0);