diff options
author | Marvin Borner | 2023-06-06 11:07:17 +0200 |
---|---|---|
committer | Marvin Borner | 2023-06-06 11:07:17 +0200 |
commit | 4b5200630ad55d2fd84ab71ad766fea81b1eaafe (patch) | |
tree | b270fb80fb1fc6f1ad6256a288fc1417c0704899 | |
parent | 1791631a3e2911afe70bf124452686e9cc9f3b06 (diff) |
Fixed some dumb bugs
-rw-r--r-- | src/map.c | 4 | ||||
-rw-r--r-- | src/term.c | 1 |
2 files changed, 3 insertions, 2 deletions
@@ -13,7 +13,7 @@ static struct hashmap *all_terms; static void hashmap_free_term(void *item) { struct term *term = *(struct term **)item; - free(term); + term_destroy_head(term); } struct hashmap *map_all_terms(void) @@ -31,7 +31,7 @@ struct term *map_get(struct hashmap *map, hash_t hash) void map_set(struct hashmap *map, struct term *term) { - if (!hashmap_get(map, term->hash)) + if (map == all_terms && !hashmap_get(map, term->hash)) schedule_add(term); // also add to schedule hashmap_set(map, &term, term->hash); } @@ -198,6 +198,7 @@ void term_rehash_parents(struct term *term) struct parent_list *next = iterator->next; free(iterator); iterator = next; + continue; } map_delete(term->parents, parent); |