Fix scope->elements iteration causing a few bugs in the doc-format

This commit is contained in:
gingerBill
2026-03-19 20:31:01 +00:00
parent 3fb430ceb7
commit 111bee6ecd
2 changed files with 17 additions and 9 deletions

View File

@@ -1042,10 +1042,12 @@ gb_internal OdinDocArray<OdinDocScopeEntry> odin_doc_add_pkg_entries(OdinDocWrit
auto entries = array_make<OdinDocScopeEntry>(heap_allocator(), 0, w->entity_cache.count);
defer (array_free(&entries));
for (auto const &element : pkg->scope->elements) {
u32 hash = element.hash;
auto interned = pkg->scope->elements.keys[hash & (pkg->scope->elements.cap-1)];
Entity *e = element.value;
for (isize i = 0; i < pkg->scope->elements.cap; i++) {
if (!pkg->scope->elements.slots[i].hash) {
continue;
}
auto interned = pkg->scope->elements.keys[i];
Entity *e = pkg->scope->elements.slots[i].value;
switch (e->kind) {
case Entity_Invalid:
case Entity_Nil: