summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--struct.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/struct.c b/struct.c
index 049051bc..a2399a4d 100644
--- a/struct.c
+++ b/struct.c
@@ -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;