diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-02-18 23:51:15 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-02-18 23:53:45 -0800 |
commit | 9d483aaaa52bc40107ad03f9c28d5fbbe9e604a0 (patch) | |
tree | 70d40e4e4d10446d62b9cd36280f312c36850bb0 /struct.c | |
parent | 9f34ee4c01ca2c70de6f60b775da5a3d761a1c1c (diff) | |
download | txr-9d483aaaa52bc40107ad03f9c28d5fbbe9e604a0.tar.gz txr-9d483aaaa52bc40107ad03f9c28d5fbbe9e604a0.tar.bz2 txr-9d483aaaa52bc40107ad03f9c28d5fbbe9e604a0.zip |
structs: bugfix: slot_cache null check.
* struct.c (struct_type_finalize): We must check slot_cache
for null. The slot symbols of a struct type being finalized
might not have slot caches.
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -211,12 +211,13 @@ static val struct_type_finalize(val obj) remhash(slot_hash, cons(slot, id)); - for (i = 0; i < SLOT_CACHE_SIZE; i++) - for (j = 0; j < 4; j++) - if (slot_cache[i][j].id == st->id) { - slot_cache[i][j].id = 0; - slot_cache[i][j].slot = 0; - } + if (slot_cache != 0) + for (i = 0; i < SLOT_CACHE_SIZE; i++) + for (j = 0; j < 4; j++) + if (slot_cache[i][j].id == st->id) { + slot_cache[i][j].id = 0; + slot_cache[i][j].slot = 0; + } } return nil; |